Exception: ShipEngine::Exceptions::ShipEngineError
- Inherits:
-
StandardError
- Object
- StandardError
- ShipEngine::Exceptions::ShipEngineError
- Defined in:
- lib/shipengine/exceptions.rb
Overview
400 error, or other “user exceptions”
Direct Known Subclasses
AccountStatusError, BusinessRulesError, SecurityError, SystemError, ValidationError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
message is inherited.
-
#request_id ⇒ 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:, request_id:, url: nil) ⇒ ShipEngineError
constructor
rubocop:todo Metrics/ParameterLists.
Constructor Details
#initialize(message:, source:, type:, code:, request_id:, url: nil) ⇒ ShipEngineError
rubocop:todo Metrics/ParameterLists
14 15 16 17 18 19 20 21 22 |
# File 'lib/shipengine/exceptions.rb', line 14 def initialize(message:, source:, type:, code:, request_id:, url: nil) # rubocop:todo Metrics/ParameterLists code = Exceptions::ErrorCode.get_by_str(code) if code.is_a?(String) super() @request_id = request_id @source = source || DEFAULT_SOURCE @type = type @code = code @url = url end |
Instance Attribute Details
#code ⇒ Object (readonly)
message is inherited
12 13 14 |
# File 'lib/shipengine/exceptions.rb', line 12 def code @code end |
#request_id ⇒ Object (readonly)
message is inherited
12 13 14 |
# File 'lib/shipengine/exceptions.rb', line 12 def request_id @request_id end |
#source ⇒ Object (readonly)
message is inherited
12 13 14 |
# File 'lib/shipengine/exceptions.rb', line 12 def source @source end |
#type ⇒ Object (readonly)
message is inherited
12 13 14 |
# File 'lib/shipengine/exceptions.rb', line 12 def type @type end |
#url ⇒ Object (readonly)
message is inherited
12 13 14 |
# File 'lib/shipengine/exceptions.rb', line 12 def url @url end |