Skip to content

Conversation

@AlexanderKolberg
Copy link
Contributor

Fixes webrpc/webrpc#205

This is some of the wonders of javascript...

throw 'im a string!!!'

Is perfectly valid javascript
So in Typescript v4(?) a thrown error has type unknown. So you always have to type guard/infere the error

  • Added tsc to the tests, so this is catchable in the tests

@AlexanderKolberg AlexanderKolberg marked this pull request as draft July 19, 2023 09:21
@AlexanderKolberg AlexanderKolberg marked this pull request as ready for review July 19, 2023 09:51
Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work :) Thanks for fixing this!

@VojtechVitek VojtechVitek merged commit f50891a into master Jul 19, 2023
@VojtechVitek VojtechVitek deleted the fix-error-type branch July 19, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"error is of type unknown"

3 participants