Sha256: 76ce77d8c5ef6f55f1dad357bc70d148b680c3a1b6f65158ced1f3e50005ddc6

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  # Raised when an API error is returned. Parent of carrier-specific API error classes.
  class ApiError < StandardError
    # @return [RestClient::Exception] the cause of the error
    attr_reader :cause

    # @param cause [RestClient::Exception] the cause of the error
    # @param message [String] optional descriptive message
    def initialize(cause, message = nil)
      @cause = cause
      super(message || cause.message)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
friendly_shipping-0.9.0 lib/friendly_shipping/api_error.rb