Created
May 17, 2012 21:53
-
-
Save gnarg/2721792 to your computer and use it in GitHub Desktop.
Better error tracing for failed error tracing
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
| 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