Errors topic
Errors
Every failure arrives as an AiException. Subclasses name the failure mode: bad credentials, rate limiting, an invalid request, a transient network or server fault, a malformed response, or a timed-out job. Catch the root type to handle any failure, or a specific subclass to react to one.
Exceptions / Errors
- AiAuthException Errors
- Raised when the provider rejects the credentials (HTTP 401 or 403).
- AiException Errors
- The base error for every failure raised by this package.
- AiInvalidRequestException Errors
- Raised when the request itself is invalid (HTTP 400 or 422).
- AiRateLimitException Errors
- Raised when the provider rate-limits the request (HTTP 429).
- AiResponseException Errors
- Raised when the provider returns a malformed or unexpected response body.
- AiTimeoutException Errors
- Raised when a long-running job poll exceeds its deadline.
- AiTransientException Errors
- Raised for retryable failures: 5xx responses, network errors, or timeouts.