pub enum ApiErrorKind {
BadRequest,
Authentication,
PermissionDenied,
NotFound,
PayloadTooLarge,
UnprocessableEntity,
RateLimit,
Overloaded,
InternalServer,
Other,
}Expand description
Coarse classification of an ApiError by status, mirroring the Python
SDK exception subclasses.
Variants§
BadRequest
400 — request body was not valid JSON (bad_json).
Authentication
401 — missing or invalid API key (unauthorized).
PermissionDenied
403 — key valid but not permitted for this resource
(mirrors the Python SDK’s TypeSafePermissionDeniedError).
NotFound
404 — unknown model alias (unknown_model).
PayloadTooLarge
413 — request payload exceeded the server limit (payload_too_large).
UnprocessableEntity
422 — body failed schema validation (invalid_body).
RateLimit
429 — rate limited (rate_limited); carries ApiError::retry_after.
Overloaded
529 — server overloaded (overloaded); carries ApiError::retry_after.
InternalServer
5xx — engine/backend failure (backend_error, internal_error).
Other
Any other status.
Implementations§
Source§impl ApiErrorKind
impl ApiErrorKind
Sourcepub fn from_status(status: u16) -> Self
pub fn from_status(status: u16) -> Self
Convert an HTTP status code into an ApiErrorKind.
Trait Implementations§
Source§impl Clone for ApiErrorKind
impl Clone for ApiErrorKind
impl Copy for ApiErrorKind
Source§impl Debug for ApiErrorKind
impl Debug for ApiErrorKind
impl Eq for ApiErrorKind
Source§impl Hash for ApiErrorKind
impl Hash for ApiErrorKind
Source§impl PartialEq for ApiErrorKind
impl PartialEq for ApiErrorKind
impl StructuralPartialEq for ApiErrorKind
Auto Trait Implementations§
impl Freeze for ApiErrorKind
impl RefUnwindSafe for ApiErrorKind
impl Send for ApiErrorKind
impl Sync for ApiErrorKind
impl Unpin for ApiErrorKind
impl UnsafeUnpin for ApiErrorKind
impl UnwindSafe for ApiErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more