Skip to content

Instantly share code, notes, and snippets.

@gnarg
Created May 17, 2012 21:53
Show Gist options
  • Select an option

  • Save gnarg/2721792 to your computer and use it in GitHub Desktop.

Select an option

Save gnarg/2721792 to your computer and use it in GitHub Desktop.
Better error tracing for failed error tracing
module NewRelic
module Agent
class ErrorCollector
def notice_error(exception, options={})
return if should_exit_notice_error?(exception)
action_path = fetch_from_options(options, :metric, (NewRelic::Agent.instance.stats_engine.scope_name || ''))
exception_options = error_params_from_options(options).merge(exception_info(exception))
add_to_error_queue(NewRelic::NoticedError.new(action_path, exception_options, exception))
exception
rescue => e
log.error("Error capturing an error. #{e.message}: #{e.backtrace.join(\"\n\")}")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment