pub enum Error {
NonSuccessStatus {
status: StatusCode,
body: Bytes,
},
BuildRequest {
source: Error,
},
UrlCannotBeABase {
url: Url,
},
ParseUri {
source: InvalidUri,
},
QueryString {
message: String,
},
SerdeUrlParams {
source: Error,
},
Json {
source: Error,
},
Custom {
message: String,
location: Location,
},
}Expand description
Errors that originate from this crate
Variants§
NonSuccessStatus
Encountered a non-success http status code that was not handled otherwise
BuildRequest
An error occurred when building a HTTP request
UrlCannotBeABase
Encountered a URL which cannot be a base where a base url was required
ParseUri
Couldn’t parse a HTTP URI
Fields
source: InvalidUriThe source invalid uri error
QueryString
A query string couldn’t be created from the given type
SerdeUrlParams
Couldn’t create a query from a given string
Json
serde_json error
Custom
custom error returned e.g. by a custom trait implementation in a different crate
Implementations§
Source§impl Error
impl Error
Query whether the error is caused by an HTTP Unauthorized status code
Sourcepub const fn is_not_found(&self) -> bool
pub const fn is_not_found(&self) -> bool
Query whether the error is caused by a HTTP NotFound status code
Sourcepub const fn is_bad_request(&self) -> bool
pub const fn is_bad_request(&self) -> bool
Query whether the error is caused by a HTTP BadRequest status code
Sourcepub const fn is_internal_server_error(&self) -> bool
pub const fn is_internal_server_error(&self) -> bool
Query whether the error is caused by a HTTP InternalServerError status code
Sourcepub const fn is_http_error_status(&self) -> bool
pub const fn is_http_error_status(&self) -> bool
Query whether the error is caused by a non-success HTTP status code
Sourcepub const fn is_specific_http_error_status(
&self,
specific_status: &StatusCode,
) -> bool
pub const fn is_specific_http_error_status( &self, specific_status: &StatusCode, ) -> bool
Query whether the error is caused by a specific HTTP status code
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read more