Class: Messaging::ExceptionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/messaging/exception_handler.rb

Class Method Summary collapse

Class Method Details

.call(exception, context = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/messaging/exception_handler.rb', line 3

def self.call(exception, context = {})
  Config.error_handlers.each do |handler|
    begin
      handler.call(exception, context)
    rescue => e
      Messaging.logger.error '!!! ERROR HANDLER THREW AN ERROR !!!'
      Messaging.logger.error e
      Messaging.logger.error e.backtrace.join("\n") unless e.backtrace.nil?
    end
  end
end