Module: Sidekiq::ExceptionHandler

Included in:
Util
Defined in:
lib/sidekiq/exception_handler.rb

Instance Method Summary collapse

Instance Method Details

#handle_exception(ex, ctxHash) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sidekiq/exception_handler.rb', line 4

def handle_exception(ex, ctxHash)
  Sidekiq.logger.warn ctxHash
  Sidekiq.logger.warn ex
  Sidekiq.logger.warn ex.backtrace.join("\n")
  # This list of services is getting a bit ridiculous.
  # For future error services, please add your own
  # middleware like BugSnag does:
  # https://github.com/bugsnag/bugsnag-ruby/blob/master/lib/bugsnag/sidekiq.rb
  send_to_airbrake(ctxHash, ex) if defined?(::Airbrake)
  send_to_honeybadger(ctxHash, ex) if defined?(::Honeybadger)
  send_to_exceptional(ctxHash, ex) if defined?(::Exceptional)
  send_to_exception_notifier(ctxHash, ex) if defined?(::ExceptionNotifier)
end