appsignal-javascript
appsignal-javascript copied to clipboard
Adapt try/catch blocks to TS 4.4
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.