pub enum ContextLiteError {
HttpError(Error),
JsonError(Error),
UrlError(ParseError),
AuthError {
message: String,
},
ServerError {
status: u16,
message: String,
},
ValidationError {
message: String,
},
ConfigError {
message: String,
},
TimeoutError {
seconds: u64,
},
ConnectionError {
message: String,
},
ResponseError {
message: String,
},
RateLimitError {
message: String,
},
ClientError {
message: String,
},
}
Expand description
The main error type for the ContextLite client
Variants§
HttpError(Error)
HTTP request errors
JsonError(Error)
JSON serialization/deserialization errors
UrlError(ParseError)
URL parsing errors
AuthError
Authentication errors
ServerError
Server returned an error status
ValidationError
Document validation errors
ConfigError
Configuration errors
TimeoutError
Timeout errors
ConnectionError
Connection pool errors
ResponseError
Invalid response format
RateLimitError
Rate limiting errors
ClientError
Generic client errors
Implementations§
Source§impl ContextLiteError
impl ContextLiteError
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a validation error
Sourcepub fn connection(message: impl Into<String>) -> Self
pub fn connection(message: impl Into<String>) -> Self
Create a connection error
Sourcepub fn rate_limit(message: impl Into<String>) -> Self
pub fn rate_limit(message: impl Into<String>) -> Self
Create a rate limit error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if this error is a client-side error
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if this error is a server-side error
Trait Implementations§
Source§impl Debug for ContextLiteError
impl Debug for ContextLiteError
Source§impl Display for ContextLiteError
impl Display for ContextLiteError
Source§impl Error for ContextLiteError
impl Error for ContextLiteError
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 From<Error> for ContextLiteError
impl From<Error> for ContextLiteError
Source§impl From<Error> for ContextLiteError
impl From<Error> for ContextLiteError
Source§impl From<ParseError> for ContextLiteError
impl From<ParseError> for ContextLiteError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ContextLiteError
impl !RefUnwindSafe for ContextLiteError
impl Send for ContextLiteError
impl Sync for ContextLiteError
impl Unpin for ContextLiteError
impl !UnwindSafe for ContextLiteError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.