#[non_exhaustive]pub enum ApiErrorKind {
InvalidRequestError,
AuthenticationError,
PermissionError,
NotFoundError,
RateLimitError,
ApiError,
OverloadedError,
Other,
}Expand description
Categories of errors the Anthropic API can return.
The wire form uses snake_case strings ending in _error
(e.g. overloaded_error). Unknown values deserialize to
ApiErrorKind::Other so a new error category from the server does not
break older SDK versions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidRequestError
400 – request was malformed or violated API constraints.
AuthenticationError
401 – API key missing or invalid.
PermissionError
403 – API key lacks permission for this resource.
NotFoundError
404 – resource does not exist.
RateLimitError
429 – rate limit exceeded.
ApiError
500 – internal server error.
OverloadedError
529 – server is overloaded.
Other
An unrecognized error category; the SDK is older than the API.
Trait Implementations§
Source§impl Clone for ApiErrorKind
impl Clone for ApiErrorKind
Source§fn clone(&self) -> ApiErrorKind
fn clone(&self) -> ApiErrorKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiErrorKind
impl Debug for ApiErrorKind
Source§impl<'de> Deserialize<'de> for ApiErrorKind
impl<'de> Deserialize<'de> for ApiErrorKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for ApiErrorKind
impl Hash for ApiErrorKind
Source§impl PartialEq for ApiErrorKind
impl PartialEq for ApiErrorKind
Source§impl Serialize for ApiErrorKind
impl Serialize for ApiErrorKind
impl Copy for ApiErrorKind
impl Eq 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
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.