#[non_exhaustive]pub enum ErrorKind {
Generic,
Configuration,
Authentication,
Permission,
RateLimit,
Validation,
NotFound,
Conflict,
Timeout,
}Expand description
A coarse classification of an Error.
For errors that came from an HTTP response the kind is derived from the status code; client-side failures (misconfiguration, timeouts) set it directly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Generic
An error that doesn’t map to a more specific kind (includes 5xx).
Configuration
The client was constructed or used with invalid configuration.
Authentication
HTTP 401 — the token is missing or invalid, or the account is inactive.
Permission
HTTP 403 — authenticated, but not permitted.
RateLimit
HTTP 429 — rate limited.
Validation
HTTP 400 — request validation failed.
NotFound
HTTP 404 or 402 — resource not found. The API uses both.
Conflict
HTTP 409 — conflicting or duplicate state.
Timeout
The client-side request timeout elapsed.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub fn from_status(status: u16) -> Self
pub fn from_status(status: u16) -> Self
Classifies an HTTP status code.
Note that 402 maps to ErrorKind::NotFound alongside 404: the API
returns 402 for some missing resources. This matches the TypeScript and
Go SDKs.
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.