Updated

lib/context_request_subscriber / error_handler.rb

A
26 lines of codes
3 methods
3.5 complexity/method
2 churn
10.48 complexity
0 duplications
# frozen_string_literal: true module ContextRequestSubscriber module ErrorHandler # :nodoc: class LogErrorHandler
  1. ContextRequestSubscriber::ErrorHandler::LogErrorHandler has no descriptive comment
def initialize(logger = nil) @logger = (logger || ContextRequestSubscriber.logger)
  1. ContextRequestSubscriber::ErrorHandler::LogErrorHandler#initialize is controlled by argument 'logger'
end def call(error, _info, _properties, _payload)
  1. ContextRequestSubscriber::ErrorHandler::LogErrorHandler#call has 4 parameters
@logger.error("Error recieved during processing the message. \ Error #{error}.") @logger.error(error.backtrace.join("\n")) if error.backtrace
  1. ContextRequestSubscriber::ErrorHandler::LogErrorHandler#call calls 'error.backtrace' 2 times
end end # :nodoc: class LogAndRaiseErrorHandler < LogErrorHandler
  1. ContextRequestSubscriber::ErrorHandler::LogAndRaiseErrorHandler has no descriptive comment
def call(error, info, properties, payload)
  1. ContextRequestSubscriber::ErrorHandler::LogAndRaiseErrorHandler#call has 4 parameters
super(error, info, properties, payload) raise error end end end end