Module: Funktor::ErrorHandler

Included in:
WorkQueueHandler
Defined in:
lib/funktor/error_handler.rb

Defined Under Namespace

Classes: Logger

Instance Method Summary collapse

Instance Method Details

#handle_error(error, context = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/funktor/error_handler.rb', line 13

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