Class: Denouncer::Notifiers::HoneybadgerNotifier

Inherits:
BaseNotifier
  • Object
show all
Defined in:
lib/denouncer/notifiers/honeybadger_notifier.rb

Instance Attribute Summary

Attributes inherited from BaseNotifier

#config

Instance Method Summary collapse

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

#nameString

Returns:

  • (String)


9
10
11
# File 'lib/denouncer/notifiers/honeybadger_notifier.rb', line 9

def name
  'honeybadger'
end

#notify(error, metadata = nil) ⇒ Object

Sends an error notification via amqp.

Parameters:

  • error (StandardError)
  • metadata (Hash) (defaults to: nil)


24
25
26
27
28
29
30
# File 'lib/denouncer/notifiers/honeybadger_notifier.rb', line 24

def notify(error,  = nil)
  Honeybadger.notify(
    error_class: error.class.name,
    error_message: error.message,
    parameters: 
  )
end

#set_configuration!(options) ⇒ Object



13
14
15
16
17
18
# File 'lib/denouncer/notifiers/honeybadger_notifier.rb', line 13

def set_configuration!(options)
  require 'honeybadger'
  require 'rack/request'
  Honeybadger.start
  return options
end