Class: SolidusSubscriptions::ProcessingErrorHandlers::RailsLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, installment = nil) ⇒ RailsLogger

Returns a new instance of RailsLogger.



10
11
12
13
# File 'lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb', line 10

def initialize(exception, installment = nil)
  @exception = exception
  @installment = installment
end

Class Method Details

.call(exception, installment = nil) ⇒ Object



6
7
8
# File 'lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb', line 6

def self.call(exception, installment = nil)
  new(exception, installment).call
end

Instance Method Details

#callObject



15
16
17
18
# File 'lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb', line 15

def call
  Rails.logger.error("Error processing installment with ID=#{installment.id}:") if installment
  Rails.logger.error(exception.message)
end