Exception: YourImageShare::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- YourImageShare::APIError
- Defined in:
- lib/yourimageshare/errors.rb
Overview
Raised for any non-2xx response or a {"type":"error"} payload -
mirrors the Go/JS/Python/PHP SDKs' error shape (status + message) so
error-handling logic reads the same across every official SDK. Ruby
convention is to raise, not to return an error object like Go does.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, message) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(status, message) ⇒ APIError
Returns a new instance of APIError.
9 10 11 12 13 |
# File 'lib/yourimageshare/errors.rb', line 9 def initialize(status, ) @status = status @message = super("yourimageshare: [#{status}] #{}") end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/yourimageshare/errors.rb', line 7 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/yourimageshare/errors.rb', line 7 def status @status end |