Exception: ShipEngine::Exceptions::ShipEngineError
- Inherits:
-
StandardError
- Object
- StandardError
- ShipEngine::Exceptions::ShipEngineError
- Defined in:
- lib/shipengine/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
message is inherited.
-
#source ⇒ Object
readonly
message is inherited.
-
#type ⇒ Object
readonly
message is inherited.
-
#url ⇒ Object
readonly
message is inherited.
Instance Method Summary collapse
-
#initialize(message:, source:, type:, code:, url: nil) ⇒ ShipEngineError
constructor
A new instance of ShipEngineError.
Constructor Details
#initialize(message:, source:, type:, code:, url: nil) ⇒ ShipEngineError
Returns a new instance of ShipEngineError.
13 14 15 16 17 18 19 20 21 |
# File 'lib/shipengine/exceptions.rb', line 13 def initialize(message:, source:, type:, code:, url: nil) code = ShipEngine::Errors::ErrorCode.get(code) if code.is_a?(String) source = ShipEngine::Errors::ErrorSource.get(source) if source.is_a?(String) super() @source = source @type = type @code = code @url = url end |
Instance Attribute Details
#code ⇒ Object (readonly)
message is inherited
11 12 13 |
# File 'lib/shipengine/exceptions.rb', line 11 def code @code end |
#source ⇒ Object (readonly)
message is inherited
11 12 13 |
# File 'lib/shipengine/exceptions.rb', line 11 def source @source end |
#type ⇒ Object (readonly)
message is inherited
11 12 13 |
# File 'lib/shipengine/exceptions.rb', line 11 def type @type end |
#url ⇒ Object (readonly)
message is inherited
11 12 13 |
# File 'lib/shipengine/exceptions.rb', line 11 def url @url end |