Module: Sidekiq::ExceptionHandler

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

Defined Under Namespace

Classes: Logger

Instance Method Summary collapse

Instance Method Details

#handle_exception(ex, ctxHash = {}) ⇒ Object


17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sidekiq/exception_handler.rb', line 17

def handle_exception(ex, ctxHash={})
  Sidekiq.error_handlers.each do |handler|
    begin
      handler.call(ex, ctxHash)
    rescue => ex
      Sidekiq.logger.error "!!! ERROR HANDLER THREW AN ERROR !!!"
      Sidekiq.logger.error ex
      Sidekiq.logger.error ex.backtrace.join("\n") unless ex.backtrace.nil?
    end
  end
end