Errors¶
Every exception the library raises on purpose derives from T3Error, and all
of them are importable from the top-level package (t3.APIError, ...). See
errors and logging for the tree and for what
gets retried.
Exceptions raised by t3api-utils.
Every exception the library raises on purpose derives from T3Error.
HTTP failures raise an APIError subclass that keeps the response.
T3Error
¶
Bases: Exception
Base class for every error t3api-utils raises.
UnknownEndpoint
¶
APIError
¶
APIError(message: str, *, response: Response, detail: str | None = None, errors: list[Any] | None = None, code: str | None = None, hint: str | None = None)
Bases: T3Error
The T3 API answered with a non-2xx status.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
The HTTP status code. |
|
response |
The full |
|
method |
The request method. |
|
url |
The request URL, with any secret key masked. |
|
detail |
The server's explanation, from a problem+json or error body. |
|
errors |
Per-item errors from a problem+json body, if any. |
|
code |
The server's machine-readable error code, if any. |
|
hint |
What to do about it, when the library knows. |
AuthError
¶
NotFound
¶
ValidationError
¶
TagListResolveError
¶
TagListResolveError(message: str, *, response: Response, detail: str | None = None, errors: list[Any] | None = None, code: str | None = None, hint: str | None = None)
Bases: ValidationError
A tag list didn't resolve: some handles matched zero or several objects.
errors holds one dict per failing handle, with handle, reason
(NOT_FOUND or AMBIGUOUS) and matchCount.