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
This will let you register an error handler using the raw HTTP responses received by stripe-node, but it will just be raw JSON here, not an instance of StripeError like you get when you .catch the result of a stripe method. You'll have access to all the data returned by the server though, so you can (await res.toJSON()).error.last_request_url if needed.
I'll leave this open as a feature request. I think a more thoughtfully-designed mechanism for "globally" extending the library / the ability to intercept/handle errors and successes at a higher level than raw http would be a good addition, but it's not something on the team's immediate roadmap.
HI @richardm-stripe,
I am interested in adding this to our codebase. Is it something that sounds interesting to you? I would need some help with the design though.
A few days ago I raised my first PR for another feature addition. You can check that here. #2151
Is your feature request related to a problem? Please describe.
I would like to listen for errors in my Stripe calls so that I can log to my error tracking service.
I see there is
stripe.on("response", (response) => {})
but it doesn't have the same details as theStripeError
object.I also noticed while upgrading my package version that you provide nice details like
request_log_url
(https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md#10140---2022-10-13).Is there a way to listen for all stripe response errors?
Describe the solution you'd like
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: