Created
January 12, 2012 23:05
-
-
Save zzak/1603702 to your computer and use it in GitHub Desktop.
Catch all exceptions and airbrake them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'airbrake' | |
Airbrake.configure do |config| | |
config.api_key = AIRBRAKE_API_KEY | |
end | |
at_exit { | |
if $! | |
e = $! | |
Airbrake.notify( | |
:backtrace => e.backtrace, | |
:error_class => e.class, | |
:error_message => e.message | |
) | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment