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 raisesAPIError 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.ValueError when no API key is provided..png?fit=max&auto=format&n=G_hwo_L4hZsQ93vT&q=85&s=c00b6042d4688a9b776bae65a530206a)