Closed Aidurber closed 5 years ago
I had a nasty crash because I had a typo, so I made a TypeScript definition file. I thought it would be useful for other users, too.
Note that in when you're in a try catch, the catch clause variable cannot have a type annotation.
You can cast the error:
// try... catch (e) { const err = e as AuthenticationError; if(err.code === "NOT_AVAILABLE"){ console.log('err') } }
And you get nice intellisense for your errors:
Let me know what you think.
Hey this looks awesome! I'll take a closer look later, and happily bring it in if so!
@Aidurber just one change and we're good!
Thanks!
🎉
I had a nasty crash because I had a typo, so I made a TypeScript definition file. I thought it would be useful for other users, too.
Note that in when you're in a try catch, the catch clause variable cannot have a type annotation.
You can cast the error:
And you get nice intellisense for your errors:
Let me know what you think.