Exception: Shotwolf::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Shotwolf::Error
- Defined in:
- lib/shotwolf/errors.rb
Overview
Raised for any non-2xx API response. type mirrors the API error envelope
(invalid_params, insufficient_credits, rate_limited, ...). status is the
HTTP status code (0 for client-side/transport errors).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(message, type: "unknown", status: 0, request_id: nil, retry_after: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, type: "unknown", status: 0, request_id: nil, retry_after: nil) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 15 16 |
# File 'lib/shotwolf/errors.rb', line 10 def initialize(, type: "unknown", status: 0, request_id: nil, retry_after: nil) super() @type = type @status = status @request_id = request_id @retry_after = retry_after end |
Instance Attribute Details
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
8 9 10 |
# File 'lib/shotwolf/errors.rb', line 8 def request_id @request_id end |
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
8 9 10 |
# File 'lib/shotwolf/errors.rb', line 8 def retry_after @retry_after end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/shotwolf/errors.rb', line 8 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/shotwolf/errors.rb', line 8 def type @type end |