Exception: FriendlyShipping::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- FriendlyShipping::ApiError
- Defined in:
- lib/friendly_shipping/api_error.rb
Overview
Raised when an API error is returned. Parent of carrier-specific API error classes.
Direct Known Subclasses
Services::RL::ApiError, Services::ShipEngine::ApiError, Services::TForceFreight::ApiError, Services::USPSShip::ApiError, Services::UpsFreight::ApiError, Services::UpsJson::ApiError
Instance Attribute Summary collapse
-
#cause ⇒ RestClient::Exception
readonly
The cause of the error.
Instance Method Summary collapse
-
#initialize(cause, message = nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(cause, message = nil) ⇒ ApiError
Returns a new instance of ApiError.
11 12 13 14 15 16 |
# File 'lib/friendly_shipping/api_error.rb', line 11 def initialize(cause, = nil) raise ArgumentError, "Must provide either a cause or a message" if cause.nil? && .nil? @cause = cause super( || cause&.) end |
Instance Attribute Details
#cause ⇒ RestClient::Exception (readonly)
Returns the cause of the error.
7 8 9 |
# File 'lib/friendly_shipping/api_error.rb', line 7 def cause @cause end |