Sha256: 36d5b734bc1defc18e8b909fbc3326e39c89d2cef74835170f40b3b1fe6f8d2b

Contents?: true

Size: 593 Bytes

Versions: 5

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true

module SolidusSubscriptions
  module ProcessingErrorHandlers
    class RailsLogger
      def self.call(exception, installment = nil)
        new(exception, installment).call
      end

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

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

      private

      attr_reader :exception, :installment
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_subscriptions-2.0.2 lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb
solidus_subscriptions-2.0.1 lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb
solidus_subscriptions-2.0.0 lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb
solidus_subscriptions-1.1.0 lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb
solidus_subscriptions-1.0.1 lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb