Exception: MisarReach::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- MisarReach::ApiError
- Defined in:
- lib/misar_reach/errors.rb
Overview
Base error raised for any non-2xx MisarReach API response.
Direct Known Subclasses
AuthError, NetworkError, NotFoundError, RateLimitError, UpgradeRequiredError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, message, code: nil, retry_after: nil, body: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(status, message, code: nil, retry_after: nil, body: nil) ⇒ ApiError
Returns a new instance of ApiError.
6 7 8 9 10 11 12 |
# File 'lib/misar_reach/errors.rb', line 6 def initialize(status, , code: nil, retry_after: nil, body: nil) @status = status @code = code @retry_after = retry_after @body = body super("misar-reach: API error #{status}#{code ? " (#{code})" : ""}: #{}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/misar_reach/errors.rb', line 4 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/misar_reach/errors.rb', line 4 def code @code end |
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
4 5 6 |
# File 'lib/misar_reach/errors.rb', line 4 def retry_after @retry_after end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/misar_reach/errors.rb', line 4 def status @status end |