Technology and Software

Hoptoad and rescue_action_in_public

Hoptoad is a nice service that lets you send all the exceptions of your Rails application to a central server. That’s a way better that having to scan log files for errors. You alse get an email notification of each event.

Unfortunately hoptoad won’t work straight out of the box (you install it with script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git) if you define rescue_action_in_public, because the latter will intercept the exceptions and prevent hoptoad to get at them.

It took me a while before figuring it out but the fix was easier to find: just add one line at the end of the method.

def rescue_action_in_public(exception)
  <your code here>
  notify_hoptoad exception
end

That’s it!

Advertisements
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s