appsignal-javascript icon indicating copy to clipboard operation
appsignal-javascript copied to clipboard

Adapt try/catch blocks to TS 4.4

Open luismiramirez opened this issue 2 years ago • 0 comments

In TS 4.4, useUnknownInCatchVariables is activated by default if you have it configured to strict: true. Which is a good practice.

This makes the caught variables in a try/catch block to be of the unknown type, so we need to check if the object we are catching is an error in our try/catch blocks to comply with this new rule.

In #567, TS got updated to 4.4 along with other dependencies to make the React 18 tests pass; the mentioned config option is explicitly deactivated until we adapt our try/catch blocks.

Official docs: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables

TODO

  • [ ] Adapt the try/catch blocks the integration has and remove the config option deactivation.

luismiramirez avatar May 12 '22 07:05 luismiramirez