airbrake/airbrake — pull request #29 by indirect (2011-11-03 10:27:12+00:00)
Title: Return nil if unexpected exceptions are raised

As I discovered today (and eventually found in issue #17), there are many more errors than just HTTP_ERRORS that can occur during #send_to_airbrake. In order to solve this problem for any future unexpected exceptions that could pop up, I added an additional rescue. The rescue logs the exception so it can hopefully be diagnosed, and then returns nil. I also added a test to ensure that random exceptions won't be propagated up into the surrounding app. I need this patch to feel safe using the airbrake gem in my app, because it's not okay for Airbrake to force a 500 error page in my Rails app when something else was supposed to happen instead.

Thanks!