Skip to content

Instantly share code, notes, and snippets.

@kenichi
Created August 2, 2017 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenichi/0f881b9cee4e3e01b573285f470865e8 to your computer and use it in GitHub Desktop.
Save kenichi/0f881b9cee4e3e01b573285f470865e8 to your computer and use it in GitHub Desktop.
require 'newrelic_rpm'
class Err
def self.do
raise 'here is an error'
end
end
desc 'test notice error'
task :error do
NewRelic::Agent.manual_start
timeout = NewRelic::Agent.config[:'rake.connect_timeout']
NewRelic::Agent.instance.wait_on_connect(timeout)
begin
Err.do
rescue => e
NewRelic::Agent.notice_error e
raise
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment