Class: Hutch::ErrorHandlers::Airbrake

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/hutch/error_handlers/airbrake.rb

Instance Method Summary collapse

Methods included from Logging

#logger, logger, logger=, setup_logger

Instance Method Details

#handle(message_id, payload, consumer, ex) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hutch/error_handlers/airbrake.rb', line 9

def handle(message_id, payload, consumer, ex)
  prefix = "message(#{message_id || '-'}): "
  logger.error prefix + "Logging event to Airbrake"
  logger.error prefix + "#{ex.class} - #{ex.message}"
  ::Airbrake.notify_or_ignore(ex, {
    :error_class => ex.class.name,
    :error_message => "#{ ex.class.name }: #{ ex.message }",
    :backtrace => ex.backtrace,
    :parameters => {
      :payload => payload,
      :consumer => consumer,
    },
    :cgi_data => ENV.to_hash,
  })
end