You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a type error in the function caller. The type error should warn that errorThrower could throw an error and therefor the error case should be handled.
Checklist
My suggestion meets these guidelines:
This wouldn't be a breaking change in existing TypeScript/JavaScript code
This wouldn't change the runtime behavior of existing JavaScript code
This could be implemented without emitting different JS based on the types of the expressions
This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
Search Terms
Suggestion
Error types
Error handling
Use Cases
Knowing if a called function could throw an error. As of now, it is not obvious if a function throws an error or not.
Examples
There should be a type error in the function
caller
. The type error should warn thaterrorThrower
could throw an error and therefor the error case should be handled.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: