diff options
Diffstat (limited to 'lib/solidus_subscriptions')
-rw-r--r-- | lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb b/lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb index d209123..d6fcf7e 100644 --- a/lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb +++ b/lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb @@ -3,21 +3,23 @@ module SolidusSubscriptions module ProcessingErrorHandlers class RailsLogger - def self.call(exception) - new(exception).call + def self.call(exception, installment = nil) + new(exception, installment).call end - def initialize(exception) + def initialize(exception, installment = nil) @exception = exception + @installment = installment end def call - Rails.logger.error exception.message + Rails.logger.error("Error processing installment with ID=#{installment.id}:") if installment + Rails.logger.error(exception.message) end private - attr_reader :exception + attr_reader :exception, :installment end end end |