Skip to content

Instantly share code, notes, and snippets.

@zzak
Created January 12, 2012 23:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzak/1603702 to your computer and use it in GitHub Desktop.
Save zzak/1603702 to your computer and use it in GitHub Desktop.
Catch all exceptions and airbrake them
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