nemoguardrails.http.errors

View as Markdown

Transport-neutral exceptions raised by the outbound HTTP subsystem.

Module Contents

Classes

NameDescription
HTTPClientErrorBase class for outbound HTTP failures.
HTTPConnectionErrorRaised when the transport cannot establish or maintain a connection.
HTTPResponseDecodeErrorRaised when a response body cannot be decoded as JSON.
HTTPStatusErrorRaised for an unsuccessful HTTP status.
HTTPTimeoutErrorRaised when an outbound request exceeds its total timeout.

API

class nemoguardrails.http.errors.HTTPClientError(
args: object = ()
)
Exception

Bases: Exception

Base class for outbound HTTP failures.

retry_count records how many retries completed before the error was returned to the caller.

retry_count
= 0
class nemoguardrails.http.errors.HTTPConnectionError()

Bases: HTTPClientError

Raised when the transport cannot establish or maintain a connection.

class nemoguardrails.http.errors.HTTPResponseDecodeError(
response: nemoguardrails.http.types.HTTPResponse
)

Bases: HTTPClientError

Raised when a response body cannot be decoded as JSON.

class nemoguardrails.http.errors.HTTPStatusError(
response: nemoguardrails.http.types.HTTPResponse,
request: nemoguardrails.http.types.HTTPRequest | None = None
)

Bases: HTTPClientError

Raised for an unsuccessful HTTP status.

retry_count
= retry_count if isinstance(retry_count, int) else 0
class nemoguardrails.http.errors.HTTPTimeoutError()

Bases: HTTPClientError

Raised when an outbound request exceeds its total timeout.