Exception: Zitadel::Client::ApiError
- Inherits:
-
ZitadelError
- Object
- StandardError
- ZitadelError
- Zitadel::Client::ApiError
- Defined in:
- lib/zitadel/client/api_error.rb
Overview
Represents an HTTP error returned from the Zitadel API.
Exposes the HTTP status code, response headers, and response body.
Instance Attribute Summary collapse
-
#code ⇒ Integer
readonly
HTTP status code.
-
#response_body ⇒ String, Typhoeus::Response
readonly
HTTP response body.
-
#response_headers ⇒ Hash{String=>Array<String>}
readonly
HTTP response headers.
Instance Method Summary collapse
-
#initialize(code, response_headers, response_body) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(code, response_headers, response_body) ⇒ ApiError
Returns a new instance of ApiError.
23 24 25 26 27 28 |
# File 'lib/zitadel/client/api_error.rb', line 23 def initialize(code, response_headers, response_body) super("Error #{code}") @code = code @response_headers = response_headers @response_body = response_body end |
Instance Attribute Details
#code ⇒ Integer (readonly)
Returns HTTP status code.
11 12 13 |
# File 'lib/zitadel/client/api_error.rb', line 11 def code @code end |
#response_body ⇒ String, Typhoeus::Response (readonly)
Returns HTTP response body.
17 18 19 |
# File 'lib/zitadel/client/api_error.rb', line 17 def response_body @response_body end |
#response_headers ⇒ Hash{String=>Array<String>} (readonly)
Returns HTTP response headers.
14 15 16 |
# File 'lib/zitadel/client/api_error.rb', line 14 def response_headers @response_headers end |