Class: Rollbar::Mode::LocalNotifier

Inherits:
Notifier
  • Object
show all
Defined in:
lib/rollbar/mode/local_notifier.rb

Overview

Local notifier that re-raises the exceptions

Instance Method Summary collapse

Instance Method Details

#log(_level, *args) ⇒ Object

Normally would send a report to Rollbar.

Accepts any number of arguments. The last String argument will become

the message or description of the report. The last Exception argument will become the associated exception for the report. The last hash argument will be used as the extra data for the report.

This method is used by code lilke:

or:

Examples:

begin
  foo = bar
rescue => e
  Rollbar.error(e)
end
begin
  foo = bar
 rescue => e
   Rollbar.log(e, 'This is a description of the exception')
 end


33
34
35
36
# File 'lib/rollbar/mode/local_notifier.rb', line 33

def log(_level, *args)
  _message, exception, _extra, _context = extract_arguments(args)
  raise(exception) if configuration.raise_on_error && exception
end