#[non_exhaustive]pub enum HttpErrorKind {
Timeout,
Connect,
Redirect,
Status(u16),
RequestBody,
ResponseBody,
Decode,
Builder,
Other,
}Expand description
Classification of an HttpError returned by HttpError::kind.
A coarse partition over the failure modes reqwest reports. Use this
when a caller wants to dispatch on the error category in a single
match; the HttpError::is_timeout / HttpError::is_connect
boolean accessors remain available for callers that test for one
specific category.
#[non_exhaustive] so new variants may be added in minor releases
without breaking callers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
Request timed out before a response was received
(HttpError::is_timeout).
Connect
Underlying connection could not be established — DNS failure,
TCP refused, TLS handshake failure (HttpError::is_connect).
Redirect
Redirect loop or too-many-redirects failure
(HttpError::is_redirect).
Status(u16)
Server returned a non-success HTTP status. The payload is the
status code as u16 (e.g. 404, 429, 503). 401 / 403 are
not surfaced here — they are caught earlier and produce
ClientError::AuthFailed.
RequestBody
Error happened while sending the request body
(HttpError::is_request).
ResponseBody
Error happened while receiving the response body
(HttpError::is_body).
Decode
Response body could not be decoded as the requested representation
(e.g. JSON parse failure inside the transport layer)
(HttpError::is_decode).
Builder
Error originated in the request builder — URL parse failure,
invalid header construction at build time, etc.
(HttpError::is_builder). Indicates a caller bug.
Other
Categorisation did not match any of the predicates above. May appear for transport-level errors that reqwest reports without setting any of the typed predicates.
Trait Implementations§
Source§impl Clone for HttpErrorKind
impl Clone for HttpErrorKind
Source§fn clone(&self) -> HttpErrorKind
fn clone(&self) -> HttpErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpErrorKind
impl Debug for HttpErrorKind
impl Eq for HttpErrorKind
Source§impl Hash for HttpErrorKind
impl Hash for HttpErrorKind
Source§impl PartialEq for HttpErrorKind
impl PartialEq for HttpErrorKind
Source§fn eq(&self, other: &HttpErrorKind) -> bool
fn eq(&self, other: &HttpErrorKind) -> bool
self and other values to be equal, and is used by ==.