#[non_exhaustive]pub enum ApiError<E>{
Client {
source: E,
},
UrlParse {
source: ParseError,
},
UriParse {
source: InvalidUri,
},
Json {
source: Error,
},
OpenTalk {
msg: String,
},
OpenTalkService {
status: StatusCode,
data: Bytes,
},
DataType {
source: Error,
typename: &'static str,
},
HttpRequestDerive {
source: Error,
},
Request {
source: Error,
},
Unauthorized,
Custom {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
}Expand description
Errors which may occur when using API endpoints.
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.
Client
The client encountered an error.
Fields
§
source: EThe source of the error.
UrlParse
The URL failed to parse.
Fields
§
source: ParseErrorThe source of the error.
UriParse
The URI failed to parse.
Fields
§
source: InvalidUriThe source of the error.
Json
JSON deserialization from OpenTalk failed.
OpenTalk
OpenTalk returned an error message.
OpenTalkService
OpenTalk returned an error without JSON information.
DataType
Failed to parse an expected data type from JSON.
Fields
HttpRequestDerive
Error from the http-request-derive crate.
Request
Couldn’t build a HTTP request, probably a bug.
Trying to perform an unauthorized request.
Custom
Custom error
Trait Implementations§
Source§impl<E> Error for ApiError<E>
impl<E> Error for ApiError<E>
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl<E> ErrorCompat for ApiError<E>
impl<E> ErrorCompat for ApiError<E>
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreSource§impl<E> From<InvalidUri> for ApiError<E>
impl<E> From<InvalidUri> for ApiError<E>
Source§fn from(error: InvalidUri) -> Self
fn from(error: InvalidUri) -> Self
Converts to this type from the input type.
Source§impl<E> From<ParseError> for ApiError<E>
impl<E> From<ParseError> for ApiError<E>
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Source§impl<E> FromString for ApiError<E>
impl<E> FromString for ApiError<E>
Source§impl<E> IntoError<ApiError<E>> for ClientSnafu
impl<E> IntoError<ApiError<E>> for ClientSnafu
Source§impl<E, __T0> IntoError<ApiError<E>> for DataTypeSnafu<__T0>
impl<E, __T0> IntoError<ApiError<E>> for DataTypeSnafu<__T0>
Source§impl<E, __T0, __T1> IntoError<ApiError<E>> for OpenTalkServiceSnafu<__T0, __T1>where
ApiError<E>: Error + ErrorCompat,
__T0: Into<StatusCode>,
__T1: Into<Bytes>,
E: Error + Send + Sync + 'static,
impl<E, __T0, __T1> IntoError<ApiError<E>> for OpenTalkServiceSnafu<__T0, __T1>where
ApiError<E>: Error + ErrorCompat,
__T0: Into<StatusCode>,
__T1: Into<Bytes>,
E: Error + Send + Sync + 'static,
Source§impl<E, __T0> IntoError<ApiError<E>> for OpenTalkSnafu<__T0>
impl<E, __T0> IntoError<ApiError<E>> for OpenTalkSnafu<__T0>
Auto Trait Implementations§
impl<E> !Freeze for ApiError<E>
impl<E> !RefUnwindSafe for ApiError<E>
impl<E> Send for ApiError<E>
impl<E> Sync for ApiError<E>
impl<E> Unpin for ApiError<E>where
E: Unpin,
impl<E> !UnwindSafe for ApiError<E>
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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