Skip to content

module exceptions.py

Global Variables

  • TYPE_CHECKING

class AnnotationException

Raised when an unsupported annotation is used.

Parameters:

  • annotation (Type): The annotation that was used.

function __init__

__init__(annotation: Type)

class DeclarativeException

Base class for all declarativex exceptions.


class DependencyValidationError

Raised when a dependency cannot be validated.

Parameters:

  • expected_type (Union[Type, Sequence[Type]]): The dependency that failed validation.
  • received_type (Type): The type that was received.

function __init__

__init__(expected_type: Union[Type, Sequence[Type]], received_type: Type)

class HTTPException

Raised when a request fails with HTTP status code.

Parameters:

  • request (httpx.Request): The request that failed.
  • response (httpx.Response): The response that was received.
  • raw_request (RawRequest): The raw request that was sent.
  • error_mappings (Mapping[int, Type]): A mapping of status codes to error models.

function __init__

__init__(
    request: Request,
    response: Response,
    raw_request: 'RawRequest',
    error_mappings: Optional[Mapping[int, Type]] = None
)

property response

The response that was received. If a model is specified, the response will be parsed and returned as an instance of that model. :return: httpx.Response or Instance of self._model


class MisconfiguredException

Raised when a client is misconfigured.


class TimeoutException

Raised when a request times out.

Parameters:

  • timeout (Optional[float]): The timeout in seconds.
  • request (httpx.Request): The request that timed out.

function __init__

__init__(timeout: Optional[float], request: Request)

class UnprocessableEntityException

Raised when a request fails when parsing of the response fails.

Parameters:

  • response (httpx.Response): The response that was received.

function __init__

__init__(response: Response)

class RateLimitExceeded

Raised when a request fails due to rate limiting.