Created
April 4, 2014 12:37
-
-
Save romatr/9973855 to your computer and use it in GitHub Desktop.
Exception backtrace
This file contains hidden or 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
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