Class: Faulty::Events::HoneybadgerListener

Inherits:
Object
  • Object
show all
Defined in:
lib/faulty/events/honeybadger_listener.rb

Overview

Reports circuit errors to Honeybadger

https://www.honeybadger.io/

The honeybadger gem must be available.

Constant Summary collapse

HONEYBADGER_EVENTS =
Set[
  :circuit_failure,
  :circuit_opened,
  :circuit_reopened,
  :cache_failure,
  :storage_failure
].freeze

Instance Method Summary collapse

Instance Method Details

#handle(event, payload) ⇒ void

This method returns an undefined value.

Handle an event raised by Faulty

Parameters:

  • event (Symbol)

    The event name. Will be a member of EVENTS.

  • payload (Hash)

    A hash with keys based on the event type


20
21
22
23
24
# File 'lib/faulty/events/honeybadger_listener.rb', line 20

def handle(event, payload)
  return unless HONEYBADGER_EVENTS.include?(event)

  send(event, payload)
end