#[non_exhaustive]pub enum Error {
Show 25 variants
StatusCode(u16),
Http(Error),
BadUri(String),
Protocol(Error),
Io(Error),
Timeout(Timeout),
HostNotFound,
RedirectFailed,
InvalidProxyUrl,
ConnectionFailed,
BodyExceedsLimit(u64),
Tls(&'static str),
Pem(Error),
Rustls(Error),
NativeTls(Error),
Der(Error),
Cookie(CookieError),
CookieValue(&'static str),
CookieJar(Error),
UnknownCharset(String),
RequireHttpsOnly(String),
LargeResponseHeader(usize, usize),
Decompress(&'static str, Error),
Json(Error),
ConnectProxyFailed(String),
}Expand description
Errors from ureq.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StatusCode(u16)
When Config::http_status_as_error is true,
4xx and 5xx response status codes are translated to this error.
This is the default behavior.
Http(Error)
Errors arising from the http-crate.
These errors happen for things like invalid characters in header names.
BadUri(String)
Error if the URI is missing scheme or host.
Protocol(Error)
An HTTP/1.1 protocol error.
This can happen if the remote server ends incorrect HTTP data like missing version or invalid chunked transfer.
Io(Error)
Error in io such as the TCP socket.
Timeout(Timeout)
Error raised if the request hits any configured timeout.
By default no timeouts are set, which means this error can’t happen.
HostNotFound
Error when resolving a hostname fails.
RedirectFailed
A redirect failed.
This happens when ureq encounters a redirect when sending a request body such as a POST request, and receives a 307/308 response. ureq refuses to redirect the POST body and instead raises this error.
InvalidProxyUrl
Error when creating proxy settings.
ConnectionFailed
A connection failed.
BodyExceedsLimit(u64)
A send body (Such as &str) is larger than the content-length header.
Tls(&'static str)
Some error with TLS.
Pem(Error)
Error in reading PEM certificates/private keys.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
Rustls(Error)
An error originating in Rustls.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
NativeTls(Error)
An error originating in Native-TLS.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
Der(Error)
An error providing DER encoded certificates or private keys to Native-TLS.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
Cookie(CookieError)
An error with the cookies.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
CookieValue(&'static str)
An error parsing a cookie value.
CookieJar(Error)
An error in the cookie store.
Note: The wrapped error struct is not considered part of ureq API. Breaking changes in that struct will not be reflected in ureq major versions.
UnknownCharset(String)
An unrecognised character set.
RequireHttpsOnly(String)
The setting Config::https_only is true and
the URI is not https.
LargeResponseHeader(usize, usize)
The response header, from status up until body, is too big.
Decompress(&'static str, Error)
Body decompression failed (gzip or brotli).
Json(Error)
Serde JSON error.
ConnectProxyFailed(String)
Attempt to connect to a CONNECT proxy failed.