-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Stripe error classes #457
Comments
Exports the errors module and the types it contains as `stripe.errors`. This allows users to match on an error with the `instanceof` operator instead of having to match on the string generated by accessing an object's `type`. Fixes #457.
That seems reasonable. I've added a pull in #459 and will gather some feedback. |
Exports the errors module and the types it contains as `stripe.errors`. This allows users to match on an error with the `instanceof` operator instead of having to match on the string generated by accessing an object's `type`. Fixes #457.
Released as 5.10.0. |
❤️ |
Hey sorry to bump this but the way it was implemented is a little annoying to use. I'm using this library with typescript and it's a little bit annoying to use Can you please make it so that |
Hi @SimonSchick, sorry for the late reply! As of stripe-node 6.18.0, errors are exported on the root Stripe object (in addition to being exported on the client instances). |
Sweet, now I can add those to the DT typings, thanks! |
Would it be possible for all stripe error classes to be exported so we can catch them via
instanceof
?The text was updated successfully, but these errors were encountered: