Module: Faktory::ExceptionHandler

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

Defined Under Namespace

Classes: Logger

Instance Method Summary collapse

Instance Method Details

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



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

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