Closed peco8 closed 7 years ago
Raising an error that is not StripeEvent::UnauthorizedError
should return a 500 error. It should be straightforward to test this.
Hi this is closed but I'd love to check my understanding. So you mean I don't really need to rescue the error here. So instead of rescuing errors, I should let it blow up?
It sounds like you have some error handling logic that needs to happen, so it makes sense that you'd need to rescue specific errors. If you need the webhook to be retried by Stripe you can re-raise after handling.
begin
do_stuff
rescue => e
handle(e)
raise # re-raise the exception.
end
@invisiblefunnel Oh exactly! Thanks!
Within a webhook, I sometimes need to expand the object for stripe (Request to Stripe for some values based on the request.)
At this point, if request fails for time out error, I'd love to return 500 explicitly.
How can I achieve this with stripe-event? Or doe this automatically return 500 if something goes wrong? (Stripe::StripeError?)