#[non_exhaustive]pub enum Error {
Reqwest(Error),
InvalidProxy {
proxy: String,
source: Box<dyn Error + Send + Sync + 'static>,
},
Build(Error),
}Expand description
Errors produced by RotatingClient and its
builder.
HTTP status codes are never errors: after the last attempt the response
is handed back as-is, whatever its status, exactly like reqwest does.
Use Response::error_for_status
if you want a non-2xx status to become an error.
Where a variant wraps a reqwest::Error, that error is this one’s
source; Reqwest and
Build do not repeat it in their own message.
InvalidProxy is the exception: its message
includes the reason for readability even though the same text is also
reachable through source.
Marked #[non_exhaustive]: new variants may be added in a minor release
without that counting as a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Reqwest(Error)
A request failed at the reqwest layer (network error, timeout,
invalid URL, …). Returned directly for failures that are not
retried, and as the last attempt’s failure once retries are used up
on a transient transport error.
InvalidProxy
A proxy URL is blank, cannot be parsed, or uses a scheme this build
does not support (SOCKS schemes need the socks feature); or a
syntactically valid proxy was rejected when the underlying
reqwest::Client was built.
source carries the reason: either a
plain-text explanation with no cause of its own, or the
reqwest::Error from the failed client build.
Fields
Build(Error)
The underlying reqwest::Client could not be built: an invalid TLS
or proxy configuration, usually.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()