Exception: Woods::Unblocked::ApiError
- Defined in:
- lib/woods/unblocked/client.rb
Overview
API error carrying the HTTP status code, so callers can branch on status (e.g. treat a 404 on delete as “already gone”) instead of matching message strings. Subclasses Woods::Error, so existing rescue Woods::Error sites keep working unchanged.
Instance Attribute Summary collapse
-
#status ⇒ Integer
readonly
HTTP status code of the failed response.
Instance Method Summary collapse
-
#initialize(message, status:) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, status:) ⇒ ApiError
Returns a new instance of ApiError.
22 23 24 25 |
# File 'lib/woods/unblocked/client.rb', line 22 def initialize(, status:) super() @status = Integer(status) end |
Instance Attribute Details
#status ⇒ Integer (readonly)
Returns HTTP status code of the failed response.
17 18 19 |
# File 'lib/woods/unblocked/client.rb', line 17 def status @status end |