Exception: Cadenya::APIResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- Cadenya::APIResponseError
- Defined in:
- lib/cadenya/core.rb
Overview
The server answered, but not with the JSON the API contract promises (e.g. an unfollowed redirect or a non-JSON success body).
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, message, body: nil) ⇒ APIResponseError
constructor
A new instance of APIResponseError.
Constructor Details
#initialize(status_code, message, body: nil) ⇒ APIResponseError
Returns a new instance of APIResponseError.
35 36 37 38 39 |
# File 'lib/cadenya/core.rb', line 35 def initialize(status_code, , body: nil) super() @status_code = status_code @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
33 34 35 |
# File 'lib/cadenya/core.rb', line 33 def body @body end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
33 34 35 |
# File 'lib/cadenya/core.rb', line 33 def status_code @status_code end |