class Denouncer::Notifiers::AirbrakeNotifier
Public Instance Methods
info(info_message, metadata = nil)
click to toggle source
Sends a info notification.
@param info_message [String] @param metadata [Hash]
# File lib/denouncer/notifiers/airbrake_notifier.rb, line 38 def info(info_message, metadata = nil) Airbrake.notify(Denouncer::InfoError.new(info_message), api_key: config[:api_key], error_message: info_message ) end
name()
click to toggle source
@return [String]
# File lib/denouncer/notifiers/airbrake_notifier.rb, line 9 def name 'airbrake' end
notify(error, metadata = nil)
click to toggle source
Sends an error notification via amqp.
@param error [StandardError] @param metadata [Hash]
# File lib/denouncer/notifiers/airbrake_notifier.rb, line 26 def notify(error, metadata = nil) Airbrake.notify(error, api_key: config[:api_key], error_message: error.message, backtrace: error.backtrace ) end
set_configuration!(options)
click to toggle source
# File lib/denouncer/notifiers/airbrake_notifier.rb, line 13 def set_configuration!(options) raise "Airbrake configuration error: :api_key is nil!" if options[:api_key].nil? require 'airbrake' Airbrake.configure do |config| config.api_key = options[:api_key] end return options end