Class: Denouncer::Notifiers::AirbrakeNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- Denouncer::Notifiers::AirbrakeNotifier
- Defined in:
- lib/denouncer/notifiers/airbrake_notifier.rb
Instance Attribute Summary
Attributes inherited from BaseNotifier
Instance Method Summary collapse
- #name ⇒ String
-
#notify(error, metadata = nil) ⇒ Object
Sends an error notification via amqp.
- #set_configuration!(options) ⇒ Object
Methods inherited from BaseNotifier
#get_current_timestamp, #get_error_cause, #initialize
Constructor Details
This class inherits a constructor from Denouncer::Notifiers::BaseNotifier
Instance Method Details
#name ⇒ String
9 10 11 |
# File 'lib/denouncer/notifiers/airbrake_notifier.rb', line 9 def name 'airbrake' end |
#notify(error, metadata = nil) ⇒ Object
Sends an error notification via amqp.
26 27 28 29 30 31 32 |
# File 'lib/denouncer/notifiers/airbrake_notifier.rb', line 26 def notify(error, = nil) Airbrake.notify(error, api_key: config[:api_key], error_message: error., backtrace: error.backtrace ) end |
#set_configuration!(options) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/denouncer/notifiers/airbrake_notifier.rb', line 13 def set_configuration!() raise "Airbrake configuration error: :api_key is nil!" if [:api_key].nil? require 'airbrake' Airbrake.configure do |config| config.api_key = [:api_key] end return end |