#[non_exhaustive]pub enum Error {
InvalidConfig(ConfigError),
RequestPreparation(RequestError),
ResponseParse(ResponseError),
Network(Error),
Server {
error_code: String,
error_message: String,
http_status: u32,
request_id: Option<String>,
},
Other(Error),
}
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.
InvalidConfig(ConfigError)
This error is caused by invalid configuration for the client, such as invalid endpoint, invalid access key, etc.
RequestPreparation(RequestError)
The request is invalid and thus will not be sent to the server, this may be caused by missing required parameters, invalid parameters, etc.
ResponseParse(ResponseError)
The response from server is invalid, which can not be parsed correctly, this may be caused by network error, server error, or other reasons.
Network(Error)
This error is caused by network error, such as connection timeout, DNS resolution error, etc.
Server
The server returns an error response with error code and message.
Other(Error)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<ConfigError> for Error
impl From<ConfigError> for Error
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<RequestError> for Error
impl From<RequestError> for Error
Source§fn from(source: RequestError) -> Self
fn from(source: RequestError) -> Self
Converts to this type from the input type.
Source§impl From<ResponseError> for Error
impl From<ResponseError> for Error
Source§fn from(source: ResponseError) -> Self
fn from(source: ResponseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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