Sha256: 159e4560da3b9195e43c9015bf0d25c97c0817697e0e347a56f2781767e27ae4

Contents?: true

Size: 533 Bytes

Versions: 3

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  class ApiFailure
    attr_reader :failure, :original_request, :original_response

    def initialize(failure, original_request:, original_response:)
      @failure = failure

      # We do not want to attach debugging information in every single response to save memory in production
      return unless original_request&.debug

      @original_request = original_request
      @original_response = original_response
    end

    def to_s
      failure.to_s
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
friendly_shipping-0.3.4 lib/friendly_shipping/api_failure.rb
friendly_shipping-0.3.3 lib/friendly_shipping/api_failure.rb
friendly_shipping-0.3.0 lib/friendly_shipping/api_failure.rb