Exception: Pangram::APIError
- Defined in:
- lib/pangram/errors.rb
Overview
Raised when Pangram rejects a request or an asynchronous task fails.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Raw response body of the failed response, when available.
-
#status ⇒ Object
readonly
HTTP status code of the failed response, when available.
Instance Method Summary collapse
-
#initialize(message, status: nil, body: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message, status: nil, body: nil) ⇒ APIError
Returns a new instance of APIError.
22 23 24 25 26 |
# File 'lib/pangram/errors.rb', line 22 def initialize(, status: nil, body: nil) super() @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Raw response body of the failed response, when available.
20 21 22 |
# File 'lib/pangram/errors.rb', line 20 def body @body end |
#status ⇒ Object (readonly)
HTTP status code of the failed response, when available.
17 18 19 |
# File 'lib/pangram/errors.rb', line 17 def status @status end |