-
-
Save 4141done/3942360 to your computer and use it in GitHub Desktop.
Airbrake Changes
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
# repo at: | |
# https://github.com/CityGrid/airbrake | |
def notify_airbrake(exception, opts={}) | |
unless airbrake_local_request? | |
Airbrake.notify(exception, airbrake_request_data.merge( :additional_fields => opts )) | |
end | |
end | |
# passes to: | |
def build_notice_for(exception, opts = {}) | |
custom_fields = {} | |
exception = unwrap_exception(exception) | |
if exception.respond_to?(:request) | |
custom_fields.merge!( | |
{ | |
"API Request" => exception.request, | |
"API Response" => exception.response, | |
"CURL" => exception.curl | |
} | |
) | |
end | |
if opts[:additional_fields] | |
custom_fields.merge!(opts[:additional_fields]) | |
opts.delete(:additional_fields) | |
end | |
opts = opts.merge(:exception => exception) if exception.is_a?(Exception) | |
opts = opts.merge(exception.to_hash) if exception.respond_to?(:to_hash) | |
opts[:parameters] = opts[:parameters].merge(custom_fields) | |
Notice.new(configuration.merge(opts)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment