#[non_exhaustive]pub enum HttpError {
Show 15 variants
RequestBuild(Error),
InvalidHeaderName(InvalidHeaderName),
InvalidHeaderValue(InvalidHeaderValue),
Timeout(Duration),
DeadlineExceeded(Duration),
Transport(Box<dyn Error + Send + Sync>),
Tls(Box<dyn Error + Send + Sync>),
BodyTooLarge {
limit: usize,
actual: usize,
},
HttpStatus {
status: StatusCode,
body_preview: String,
content_type: Option<String>,
retry_after: Option<Duration>,
},
Json(Error),
FormEncode(Error),
Overloaded,
ServiceClosed,
InvalidUri {
url: String,
kind: InvalidUriKind,
reason: String,
},
InvalidScheme {
scheme: String,
reason: String,
},
}Expand description
HTTP client error types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RequestBuild(Error)
Request building failed
InvalidHeaderName(InvalidHeaderName)
Invalid header name
InvalidHeaderValue(InvalidHeaderValue)
Invalid header value
Timeout(Duration)
Single request attempt timed out
DeadlineExceeded(Duration)
Total operation deadline exceeded (including all retries)
Transport(Box<dyn Error + Send + Sync>)
Transport error (network, connection, etc)
Tls(Box<dyn Error + Send + Sync>)
TLS error
BodyTooLarge
Response body exceeded size limit
HttpStatus
HTTP non-2xx status
Fields
status: StatusCodeJson(Error)
JSON parsing error
FormEncode(Error)
Form URL encoding error
Overloaded
Service overloaded (concurrency limit reached, fail-fast)
ServiceClosed
Internal service failure (buffer worker died, channel closed)
InvalidUri
Invalid URL (failed to parse)
Use the kind field for programmatic matching. The reason field contains
a diagnostic message intended for logging only; do not match on its contents
as the format is unstable and may change between releases.
Fields
kind: InvalidUriKindStructured failure classification for programmatic matching
InvalidScheme
Invalid URL scheme for transport security configuration
Trait Implementations§
Source§impl Error for HttpError
impl Error for HttpError
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
Source§impl From<InvalidHeaderName> for HttpError
impl From<InvalidHeaderName> for HttpError
Source§fn from(source: InvalidHeaderName) -> Self
fn from(source: InvalidHeaderName) -> Self
Source§impl From<InvalidHeaderValue> for HttpError
impl From<InvalidHeaderValue> for HttpError
Source§fn from(source: InvalidHeaderValue) -> Self
fn from(source: InvalidHeaderValue) -> Self
Auto Trait Implementations§
impl Freeze for HttpError
impl !RefUnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl UnsafeUnpin for HttpError
impl !UnwindSafe for HttpError
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read moreSource§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.