openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
273 stars 200 forks source link

Assume errors are of type unknown instead of type error #594

Open TimoGlastra opened 2 years ago

TimoGlastra commented 2 years ago

We want to use unknown in catch statements. Before typescript 4.4 any was the default but this is now switched to unknown. Once we have migrated all catch statements to assume error is of type unknown we can upgrade to the new typescript version

We could also use useUnknownInCatchVariables: false in the root tsconfig.build.json for now

brianorwhatever commented 2 years ago

Looks like you've got this fixed in https://github.com/animo/aries-framework-javascript/tree/build/demo-tsconfig Any timeline for when that will be in main?

TimoGlastra commented 2 years ago

Hi @brianorwhatever,

Sadly this hasn't been addressed yet. That PR locks the version of TS to an older version so we don't get the error, but we still need to update all catch statements to assume the errors are of type unknown.

Do you have a specific need for this change?

brianorwhatever commented 2 years ago

I was having troubles getting the demos running but I did the same and locked the ts version and it worked after that so I'm not in a hurry anymore. thanks!