Module: Nsqcd::ErrorReporter

Included in:
Worker
Defined in:
lib/nsqcd/error_reporter.rb

Defined Under Namespace

Classes: DefaultLogger

Instance Method Summary collapse

Instance Method Details

#worker_error(exception, context_hash = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/nsqcd/error_reporter.rb', line 14

def worker_error(exception, context_hash = {})
  Nsqcd.error_reporters.each do |handler|
    begin
      handler.call(exception, self, context_hash)
    rescue => inner_exception
      Nsqcd.logger.error '!!! ERROR REPORTER THREW AN ERROR !!!'
      Nsqcd.logger.error inner_exception
      Nsqcd.logger.error inner_exception.backtrace.join("\n") unless inner_exception.backtrace.nil?
    end
  end
end