Exception: Seekrit::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/seekrit/errors.rb

Overview

The resolve API returned a non-2xx response.

Instance Attribute Summary collapse

Instance Method Summary collapse

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, message)
  @status = status
  @code = code
  super("#{status} #{code}: #{message}")
end

Instance Attribute Details

#codeString (readonly)

Returns error.code from the API body (e.g. "unauthorized", "forbidden", "not_found"), or "internal" if the body did not parse.

Returns:

  • (String)

    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

#statusInteger (readonly)

Returns HTTP status code.

Returns:

  • (Integer)

    HTTP status code.



15
16
17
# File 'lib/seekrit/errors.rb', line 15

def status
  @status
end