Exception: Puid::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Puid::Error
- Defined in:
- lib/puid.rb
Overview
Raised for any non-2xx API response or client-side validation failure. status is the HTTP status (nil for client-side/transport errors); code is the API’s machine-readable error code (e.g. “rate_limited”, “quota_exceeded”).
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, status: nil, code: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status: nil, code: nil) ⇒ Error
Returns a new instance of Error.
24 25 26 27 28 |
# File 'lib/puid.rb', line 24 def initialize(, status: nil, code: nil) super() @status = status @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
22 23 24 |
# File 'lib/puid.rb', line 22 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
22 23 24 |
# File 'lib/puid.rb', line 22 def status @status end |