Exception: Fluence::Gateway::RequestError
- Defined in:
- lib/fluence/gateway/errors.rb
Overview
Raised when the target service responded with a 4xx/5xx HTTP status.
Wraps the underlying OAuth2::Error but hides the OAuth2 dependency
from callers and exposes status, body, and headers directly so
consumers don't need to reach into error.response.*.
Instance Attribute Summary collapse
-
#body ⇒ String?
readonly
Returns the raw response body of the failed response.
-
#headers ⇒ Hash?
readonly
Returns the response headers of the failed response.
-
#status ⇒ Integer?
readonly
Returns the HTTP status code of the failed response.
Instance Method Summary collapse
-
#initialize(message, response: nil) ⇒ RequestError
constructor
Builds a new RequestError wrapping the given message and optional response.
Constructor Details
#initialize(message, response: nil) ⇒ RequestError
Builds a new RequestError wrapping the given message and optional response. Callers typically do not call this directly — the gateway client raises it automatically when the target service returns 4xx/5xx.
Instance Attribute Details
#body ⇒ String? (readonly)
Returns the raw response body of the failed response.
#headers ⇒ Hash? (readonly)
Returns the response headers of the failed response.
#status ⇒ Integer? (readonly)
Returns the HTTP status code of the failed response.