Class: MultiDaemons::ErrorReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/multi_daemons/error_reporter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#reportersObject

Returns the value of attribute reporters.



3
4
5
# File 'lib/multi_daemons/error_reporter.rb', line 3

def reporters
  @reporters
end

Class Method Details

.report(exception, context_hash = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/multi_daemons/error_reporter.rb', line 5

def self.report(exception, context_hash = {})
  MultiDaemons.error_reporters.compact.each do |reporter|
    begin
      reporter.call(exception, self, context_hash)
    rescue => inner_exception
      Log.log inner_exception
      backtrace = inner_exception.backtrace.join("\n")
      Log.log backtrace unless inner_exception.backtrace
    end
  end
end