Exception: Seekrit::ApiError
- Defined in:
- lib/seekrit/errors.rb
Overview
The resolve API returned a non-2xx response.
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
Error.code from the API body (e.g. "unauthorized", "forbidden", "not_found"), or "internal" if the body did not parse.
-
#status ⇒ Integer
readonly
HTTP status code.
Instance Method Summary collapse
-
#initialize(status, code, message) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(status, code, message) ⇒ ApiError
Returns a new instance of ApiError.
20 21 22 23 24 |
# File 'lib/seekrit/errors.rb', line 20 def initialize(status, code, ) @status = status @code = code super("#{status} #{code}: #{}") end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns error.code from the API body (e.g. "unauthorized", "forbidden", "not_found"), or "internal" if the body did not parse.
18 19 20 |
# File 'lib/seekrit/errors.rb', line 18 def code @code end |
#status ⇒ Integer (readonly)
Returns HTTP status code.
15 16 17 |
# File 'lib/seekrit/errors.rb', line 15 def status @status end |