Class: Hutch::ErrorHandlers::Rollbar

Inherits:
Base
  • Object
show all
Defined in:
lib/hutch/error_handlers/rollbar.rb

Instance Method Summary collapse

Methods included from Logging

#logger, logger, logger=, setup_logger

Instance Method Details

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



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/hutch/error_handlers/rollbar.rb', line 8

def handle(properties, payload, consumer, ex)
  message_id = properties.message_id
  prefix = "message(#{message_id || '-'}):"
  logger.error "#{prefix} Logging event to Rollbar"
  logger.error "#{prefix} #{ex.class} - #{ex.message}"

  ::Rollbar.error(ex,
    payload: payload,
    consumer: consumer
  )
end

#handle_setup_exception(ex) ⇒ Object



20
21
22
23
24
25
# File 'lib/hutch/error_handlers/rollbar.rb', line 20

def handle_setup_exception(ex)
  logger.error "Logging setup exception to Rollbar"
  logger.error "#{ex.class} - #{ex.message}"

  ::Rollbar.error(ex)
end