Class: Superbolt::ErrorNotifier::Airbrake

Inherits:
Object
  • Object
show all
Defined in:
lib/superbolt/error_notifier/airbrake.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Airbrake

Returns a new instance of Airbrake.



4
5
6
# File 'lib/superbolt/error_notifier/airbrake.rb', line 4

def initialize(logger)
  @logger = logger
end

Instance Method Details

#error!(exception, superbolt_message = nil) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/superbolt/error_notifier/airbrake.rb', line 8

def error!(exception, superbolt_message = nil)
  if defined? ::Airbrake
    ::Airbrake.notify_or_ignore(exception, parameters: superbolt_message)
  else
    @logger.warn("You have configured Superbolt to send errors to Airbrake, but Airbrake is not available or is not configured!")
  end
end