DEV Community

Discussion on: Handling stripe webhooks with Ruby on Rails

Collapse
 
maxencehenneron profile image
Maxence Henneron • Edited

The EventHandler is a pure ruby object, and therefore does not have any of the rails helpers. It is actually an error in my article.

If you want to raise an error when the webhook fails, you can use

rescue JSON::ParserError => e
   handle_error()
   raise  # re-raise the exception.
end

The response sent by your server will be a 500 and the webhook will fail