pub enum Error {
Middleware(Error),
Reqwest(Error),
}
Variants§
Middleware(Error)
There was an error running some middleware
Reqwest(Error)
Error from the underlying reqwest client
Implementations§
Source§impl Error
impl Error
pub fn middleware<E>(err: E) -> Self
Sourcepub fn url_mut(&mut self) -> Option<&mut Url>
pub fn url_mut(&mut self) -> Option<&mut Url>
Returns a mutable reference to the URL related to this error.
This is useful if you need to remove sensitive information from the URL (e.g. an API key in the query), but do not want to remove the URL entirely.
Sourcepub fn with_url(self, url: Url) -> Self
pub fn with_url(self, url: Url) -> Self
Adds a url related to this error (overwriting any existing).
Sourcepub fn without_url(self) -> Self
pub fn without_url(self) -> Self
Strips the related URL from this error (if, for example, it contains sensitive information).
Sourcepub fn is_middleware(&self) -> bool
pub fn is_middleware(&self) -> bool
Returns true if the error is from any middleware.
Sourcepub fn is_builder(&self) -> bool
pub fn is_builder(&self) -> bool
Returns true if the error is from a type Builder
.
Sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
Returns true if the error is from a RedirectPolicy
.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if the error is related to a timeout.
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
Returns true if the error is related to the request.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Returns true if the error is related to connect.
Sourcepub fn is_body(&self) -> bool
pub fn is_body(&self) -> bool
Returns true if the error is related to the request or response body.
Sourcepub fn is_decode(&self) -> bool
pub fn is_decode(&self) -> bool
Returns true if the error is related to decoding the response’s body.
Sourcepub fn status(&self) -> Option<StatusCode>
pub fn status(&self) -> Option<StatusCode>
Returns the status code, if the error was generated from a response.