#[non_exhaustive]pub enum FetchError {
Network(String),
UnsupportedScheme(String),
InvalidRequest(String),
Blocked(String),
NoProvider,
}Expand description
Why there is no response.
Note what is not here: an HTTP status. A server that answered is a
FetchResponse whatever it answered with. These are the cases where
nothing answered.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network(String)
The request could not be completed: DNS, TLS, connection, timeout, a malformed response, or a local read that failed.
One variant rather than a taxonomy because fetch() itself exposes one
(TypeError), and a guest cannot act differently on a DNS failure than
on a TLS one. The string is for a human reading a log.
UnsupportedScheme(String)
The URL’s scheme is not one this provider serves.
InvalidRequest(String)
The request was rejected before it was sent: an unparseable header, a method the provider will not issue.
Blocked(String)
Refused by policy rather than by the network. A provider that enforces an allowlist, or refuses to let an opaque origin reach the network, answers with this.
NoProvider
There is no provider installed. See DummyFetchProvider.
Trait Implementations§
Source§impl Clone for FetchError
impl Clone for FetchError
Source§impl Debug for FetchError
impl Debug for FetchError
Source§impl Display for FetchError
impl Display for FetchError
impl Eq for FetchError
Source§impl Error for FetchError
impl Error for FetchError
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()