#[non_exhaustive]pub enum HttpError {
BadUrl(String),
Timeout,
Dns,
Connect,
Tls(String),
Io(String),
Cancelled,
Unsupported,
TooManyRedirects,
Status(u16),
BodyTooLarge {
limit: usize,
},
}Expand description
A transport-level failure. HTTP error statuses (4xx/5xx) are not here; they arrive as
Response::status. The portable core maps from each platform’s taxonomy (docs/http.md).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadUrl(String)
The URL failed to parse (or uses an unsupported scheme).
Timeout
The request exceeded Request::timeout or its total limit.
Dns
Host name resolution failed.
Connect
The connection could not be established (refused, unreachable, reset mid-handshake).
Tls(String)
TLS handshake / certificate failure, including a server a pin or a trust handler refused.
Io(String)
Everything else the platform reported (message passed through).
Cancelled
The request was cancelled: its FetchFuture dropped, or a platform-side cancel.
Unsupported
No HTTP capability on this platform (Tier::Unavailable), or an entry point or option
that cannot exist on it (the blocking calls on the web’s single thread, see docs/http.md).
TooManyRedirects
More redirects than Redirects::Follow allows.
Status(u16)
A status the caller could not accept, such as a download manager’s unexpected 416.
BodyTooLarge
The response exceeded the caller’s explicit buffered-body limit.
Trait Implementations§
impl Eq for HttpError
Source§impl Error for HttpError
impl Error for HttpError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()