Exception: Easyship::Errors::EasyshipError
- Inherits:
-
StandardError
- Object
- StandardError
- Easyship::Errors::EasyshipError
- Defined in:
- lib/easyship/errors/easyship_error.rb
Overview
Represents an error that is raised when an error occurs in the Easyship API.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#response_headers ⇒ Object
readonly
Returns the value of attribute response_headers.
Instance Method Summary collapse
- #body_error ⇒ Object
-
#initialize(message: '', body_error: {}, error: {}, response_body: nil, response_headers: {}) ⇒ EasyshipError
constructor
A new instance of EasyshipError.
Constructor Details
#initialize(message: '', body_error: {}, error: {}, response_body: nil, response_headers: {}) ⇒ EasyshipError
Returns a new instance of EasyshipError.
9 10 11 12 13 14 15 16 |
# File 'lib/easyship/errors/easyship_error.rb', line 9 def initialize(message: '', body_error: {}, error: {}, response_body: nil, response_headers: {}) super() @error = error @message = @body_error = body_error @response_body = response_body @response_headers = response_headers end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
7 8 9 |
# File 'lib/easyship/errors/easyship_error.rb', line 7 def error @error end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/easyship/errors/easyship_error.rb', line 7 def @message end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
7 8 9 |
# File 'lib/easyship/errors/easyship_error.rb', line 7 def response_body @response_body end |
#response_headers ⇒ Object (readonly)
Returns the value of attribute response_headers.
7 8 9 |
# File 'lib/easyship/errors/easyship_error.rb', line 7 def response_headers @response_headers end |
Instance Method Details
#body_error ⇒ Object
18 19 20 21 |
# File 'lib/easyship/errors/easyship_error.rb', line 18 def body_error warn '[DEPRECATION] `body_error` is deprecated. Please use `error` instead.' @body_error end |