#[non_exhaustive]pub enum ErrorKind {
Show 13 variants
BadRequest,
Authentication,
PermissionDenied,
NotFound,
Unprocessable,
RateLimit,
Overloaded,
Server,
UnexpectedStatus,
Timeout,
Connection,
InvalidResponse,
InvalidRequest,
}Expand description
What went wrong, as a category a caller can act on.
The HTTP kinds mirror the error classes of the official SDKs. A command-line tool maps these to exit codes; a program decides whether to give up, re-authenticate or slow down.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadRequest
400: the API could not make sense of the request.
Authentication
401: the API key is missing or not valid.
PermissionDenied
403: the key is valid but may not do this.
NotFound
404: no such endpoint or model.
Unprocessable
422: the request body failed the API’s validation.
RateLimit
429: too many requests or tokens. Slow down.
Overloaded
529: the service is temporarily overloaded.
Server
Any other 5xx: the service failed.
UnexpectedStatus
A status this crate has no better category for, such as 408 or an unexpected redirect.
Timeout
An attempt did not complete within the timeout.
Connection
The server could not be reached, or the connection was lost before the response was read.
InvalidResponse
The server answered with success, but the body was not what the API documents.
InvalidRequest
The request could not be built or sent for a reason that is the caller’s to fix.
Implementations§
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.