Skip to content

Instantly share code, notes, and snippets.

@romatr
Created April 4, 2014 12:37
Show Gist options
  • Save romatr/9973855 to your computer and use it in GitHub Desktop.
Save romatr/9973855 to your computer and use it in GitHub Desktop.
Exception backtrace
ActiveSupport::Notifications::Instrumenter.class_eval do
def instrument(name, payload = {})
start name, payload
begin
yield payload
rescue Exception => e
payload[:exception] = [e.class.name, e.message, e.backtrace]
raise e
ensure
finish name, payload
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment