pub enum HttpClientError {
Show 21 variants
NoUrlsProvided,
ReqwestBuildError {
source: Error,
},
GenericRequestFailure(String),
ReqwestClientError {
source: Error,
},
MalformedUrl {
raw: String,
source: Error,
},
RequestSendFailure {
url: Url,
source: ReqwestErrorWrapper,
},
ResponseReadFailure {
url: Url,
headers: Box<HeaderMap>,
status: StatusCode,
source: ReqwestErrorWrapper,
},
ResponseDeserialisationFailure {
source: Error,
},
UrlParseFailure {
source: ParseError,
},
NotFound {
url: Url,
},
AttemptedToCloneStreamRequest,
RequestFailure {
url: Url,
status: StatusCode,
headers: Box<HeaderMap>,
},
EmptyResponse {
url: Url,
status: StatusCode,
headers: Box<HeaderMap>,
},
EndpointFailure {
url: Url,
status: StatusCode,
headers: Box<HeaderMap>,
error: String,
},
ResponseDecodeFailure {
message: String,
content: String,
},
InternalResponseInconsistency {
url: Url,
details: String,
},
DnsLookupFailure {
inner: ResolveError,
},
Bincode(Error),
Json(Error),
Yaml(Error),
Plain(Error),
}Expand description
The Errors that may occur when creating or using an HTTP client.
Variants§
NoUrlsProvided
ReqwestBuildError
GenericRequestFailure(String)
👎Deprecated: use another more strongly typed variant - this variant is only left for compatibility reasons
ReqwestClientError
👎Deprecated: use another more strongly typed variant - this variant is only left for compatibility reasons
Fields
MalformedUrl
RequestSendFailure
ResponseReadFailure
ResponseDeserialisationFailure
UrlParseFailure
Fields
§
source: ParseErrorNotFound
AttemptedToCloneStreamRequest
RequestFailure
EmptyResponse
EndpointFailure
ResponseDecodeFailure
InternalResponseInconsistency
DnsLookupFailure
Fields
§
inner: ResolveErrorBincode(Error)
Json(Error)
Yaml(Error)
Plain(Error)
Implementations§
Source§impl HttpClientError
impl HttpClientError
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if the error is a timeout.
Sourcepub fn status_code(&self) -> Option<StatusCode>
pub fn status_code(&self) -> Option<StatusCode>
Returns the HTTP status code if available.
pub fn reqwest_client_build_error(source: Error) -> Self
pub fn request_send_error(url: Url, source: Error) -> Self
Trait Implementations§
Source§impl Debug for HttpClientError
impl Debug for HttpClientError
Source§impl Display for HttpClientError
impl Display for HttpClientError
Source§impl Error for HttpClientError
impl Error for HttpClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for HttpClientError
impl From<Error> for HttpClientError
Source§impl From<Error> for HttpClientError
impl From<Error> for HttpClientError
Source§impl From<Error> for HttpClientError
impl From<Error> for HttpClientError
Source§impl From<Error> for HttpClientError
impl From<Error> for HttpClientError
Source§impl From<ParseError> for HttpClientError
impl From<ParseError> for HttpClientError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ResolveError> for HttpClientError
impl From<ResolveError> for HttpClientError
Source§fn from(source: ResolveError) -> Self
fn from(source: ResolveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HttpClientError
impl !RefUnwindSafe for HttpClientError
impl Send for HttpClientError
impl Sync for HttpClientError
impl Unpin for HttpClientError
impl !UnwindSafe for HttpClientError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.