Class: Hutch::ErrorHandlers::Sentry
- Inherits:
-
Object
- Object
- Hutch::ErrorHandlers::Sentry
- Includes:
- Logging
- Defined in:
- lib/hutch/error_handlers/sentry.rb
Instance Method Summary collapse
- #handle(message_id, payload, consumer, ex) ⇒ Object
-
#initialize ⇒ Sentry
constructor
A new instance of Sentry.
Methods included from Logging
#logger, logger, logger=, setup_logger
Constructor Details
#initialize ⇒ Sentry
Returns a new instance of Sentry.
9 10 11 12 13 |
# File 'lib/hutch/error_handlers/sentry.rb', line 9 def initialize unless Raven.respond_to?(:capture_exception) raise "The Hutch Sentry error handler requires Raven >= 0.4.0" end end |
Instance Method Details
#handle(message_id, payload, consumer, ex) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/hutch/error_handlers/sentry.rb', line 15 def handle(, payload, consumer, ex) prefix = "message(#{ || '-'}): " logger.error prefix + "Logging event to Sentry" logger.error prefix + "#{ex.class} - #{ex.}" Raven.capture_exception(ex) end |