Errors and warnings¶
Every non-2xx answer becomes one of these exceptions, carrying the HTTP status, the server's message
and the parsed body. All of them derive from WitanError, so one except WitanError catches
everything the SDK raises.
Typed errors. Every non-2xx answer from WITAN becomes one of these, carrying the HTTP status, the server's error message and the raw JSON body.
WitanError ¶
Bases: Exception
Base class for every error raised by the SDK.
ValidationError ¶
AuthError ¶
PaymentRequiredError ¶
NotFoundError ¶
ConflictError ¶
RateLimitError ¶
ServerError ¶
WaitTimeout ¶
raise_for ¶
Turn an httpx error response into the matching WitanError.
SignatureError ¶
WitanDeprecationWarning ¶
Bases: FutureWarning
A route this SDK called is deprecated on the server.
A FutureWarning, so Python shows it by default. Silence it with
warnings.simplefilter("ignore", WitanDeprecationWarning) or fail on it in CI with
warnings.simplefilter("error", WitanDeprecationWarning).