pub enum AnthropicError {
CODE400(AnthropicErrorBody),
CODE401(AnthropicErrorBody),
CODE403(AnthropicErrorBody),
CODE404(AnthropicErrorBody),
CODE413(AnthropicErrorBody),
CODE429(AnthropicErrorBody),
CODE500(AnthropicErrorBody),
CODE503(AnthropicErrorBody),
Undefined(u16, String),
ErrorSendingRequest(String),
ErrorGettingResponseBody(String),
ErrorDeserializingResponseBody(u16, String),
}
Expand description
§AnthropicError
This error type largely mirrors the error codes list here https://docs.anthropic.com/en/api/errors.
Variants§
CODE400(AnthropicErrorBody)
§There was an issue with the format or content of your request.
§We may also use this error type for other 4XX status codes not listed below.
CODE401(AnthropicErrorBody)
§There’s an issue with your API key
CODE403(AnthropicErrorBody)
§Your API key does not have permission to use the specified resource.
CODE404(AnthropicErrorBody)
§The requested resource was not found.
CODE413(AnthropicErrorBody)
§Request exceeds the maximum allowed number of bytes.
CODE429(AnthropicErrorBody)
§Your account has hit a rate limit.
CODE500(AnthropicErrorBody)
§An unexpected error has occurred internal to Anthropic’s systems
CODE503(AnthropicErrorBody)
§Anthropic’s API is temporarily overloaded.
Undefined(u16, String)
§Missed cases for error codes, includes Status Code and Error Body as a string. These can also represent internal logic errors.
ErrorSendingRequest(String)
§Carries underlying error that may have occurred during sending the request
ErrorGettingResponseBody(String)
§Carries underlying error that may have occured when trying to get the response body
ErrorDeserializingResponseBody(u16, String)
Trait Implementations§
Source§impl Clone for AnthropicError
impl Clone for AnthropicError
Source§fn clone(&self) -> AnthropicError
fn clone(&self) -> AnthropicError
Returns a copy 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 AnthropicError
impl Debug for AnthropicError
Source§impl Display for AnthropicError
impl Display for AnthropicError
Source§impl Error for AnthropicError
impl Error for AnthropicError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for AnthropicError
impl PartialEq for AnthropicError
impl StructuralPartialEq for AnthropicError
Auto Trait Implementations§
impl Freeze for AnthropicError
impl RefUnwindSafe for AnthropicError
impl Send for AnthropicError
impl Sync for AnthropicError
impl Unpin for AnthropicError
impl UnwindSafe for AnthropicError
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<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 more