Skip to main content
All exceptions are importable from deutero and from deutero.exceptions. For patterns and examples, see Error handling.

DeuteroError

The base class for every SDK exception.
str
A human-readable description.

APIError

Raised for any non-2xx API response. Subclasses are chosen by status code; a status with no specific subclass raises APIError itself.
str
HTTP <status>: <detail>. Lists of field-level validation errors are joined into one readable line.
int
The HTTP status code.
Any
The parsed response body (a dict for JSON, otherwise the text), or None for an empty body.
str | None
The x-request-id response header, if present.

API error subclasses

Client-side errors

ConnectionError and TimeoutError share names with Python built-ins but don’t subclass them. Catch deutero.ConnectionError and deutero.TimeoutError explicitly.
The client constructor raises the built-in ValueError when no API key is provided.