#[non_exhaustive]pub enum HttpError {
Show 40 variants
DnsTimeout,
DnsError(DnsErrorPayload),
DestinationNotFound,
DestinationUnavailable,
DestinationIpProhibited,
DestinationIpUnroutable,
ConnectionRefused,
ConnectionTerminated,
ConnectionTimeout,
ConnectionReadTimeout,
ConnectionWriteTimeout,
ConnectionLimitReached,
TlsProtocolError,
TlsCertificateError,
TlsAlertReceived(TlsAlertReceivedPayload),
HttpRequestDenied,
HttpRequestLengthRequired,
HttpRequestBodySize(Option<u64>),
HttpRequestMethodInvalid,
HttpRequestUriInvalid,
HttpRequestUriTooLong,
HttpRequestHeaderSectionSize(Option<u32>),
HttpRequestHeaderSize(Option<FieldSizePayload>),
HttpRequestTrailerSectionSize(Option<u32>),
HttpRequestTrailerSize(FieldSizePayload),
HttpResponseIncomplete,
HttpResponseHeaderSectionSize(Option<u32>),
HttpResponseHeaderSize(FieldSizePayload),
HttpResponseBodySize(Option<u64>),
HttpResponseTrailerSectionSize(Option<u32>),
HttpResponseTrailerSize(FieldSizePayload),
HttpResponseTransferCoding(Option<String>),
HttpResponseContentCoding(Option<String>),
HttpResponseTimeout,
HttpUpgradeFailed,
HttpProtocolError,
LoopDetected,
ConfigurationError,
Internal(Option<String>),
TooManyRedirects,
}Expand description
Why a request got no response, or its body stopped short.
WASI 0.3’s error-code cases, Rust-named, so a WebAssembly component’s adapter passes them
through and every other platform maps its own failures into them; TooManyRedirects is
Waft’s, the one thing WASI leaves to the application.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DnsTimeout
The DNS lookup did not finish in the time the platform allowed.
DnsError(DnsErrorPayload)
The DNS lookup failed: rcode is the resolver’s response code when it gave one, and
info_code its extended information code.
DestinationNotFound
The destination host or path was not found.
The destination is temporarily unavailable.
DestinationIpProhibited
The destination’s address is one the platform’s policy forbids.
DestinationIpUnroutable
The destination’s address cannot be routed from this network.
ConnectionRefused
The server refused the connection.
ConnectionTerminated
The connection ended before the exchange did.
ConnectionTimeout
Connecting to the server took longer than SendOptions::connect_timeout.
ConnectionReadTimeout
Reading from the connection took longer than the platform allows.
ConnectionWriteTimeout
Writing to the connection took longer than the platform allows.
ConnectionLimitReached
The platform’s limit on open connections was reached.
TlsProtocolError
TLS failed: the handshake or one of its records was not valid TLS.
TlsCertificateError
TLS refused the server’s certificate, or the server refused the client’s.
TlsAlertReceived(TlsAlertReceivedPayload)
The peer sent a TLS alert: alert_id is the alert’s number when it gave one, and
alert_message its description.
HttpRequestDenied
The platform’s policy does not allow the request.
HttpRequestLengthRequired
The request must say its length, and does not.
HttpRequestBodySize(Option<u64>)
The request body is larger than the platform allows; the limit, when it names one.
HttpRequestMethodInvalid
The method is not a valid HTTP method.
HttpRequestUriInvalid
The URI is not one the client can send to.
HttpRequestUriTooLong
The URI is longer than the platform allows.
HttpRequestHeaderSectionSize(Option<u32>)
The request’s header section is larger than the platform allows; the limit, when it names one.
HttpRequestHeaderSize(Option<FieldSizePayload>)
One of the request’s header fields is too large: which field, and the limit, when the platform names them.
HttpRequestTrailerSectionSize(Option<u32>)
The request’s trailer section is larger than the platform allows; the limit, when it names one.
HttpRequestTrailerSize(FieldSizePayload)
One of the request’s trailer fields is too large.
HttpResponseIncomplete
The response ended before its head or body was whole.
HttpResponseHeaderSectionSize(Option<u32>)
The response’s header section is larger than the platform allows; the limit, when it names one.
HttpResponseHeaderSize(FieldSizePayload)
One of the response’s header fields is too large.
HttpResponseBodySize(Option<u64>)
The response body is larger than the platform allows; the limit, when it names one.
HttpResponseTrailerSectionSize(Option<u32>)
The response’s trailer section is larger than the platform allows; the limit, when it names one.
HttpResponseTrailerSize(FieldSizePayload)
One of the response’s trailer fields is too large.
HttpResponseTransferCoding(Option<String>)
The response’s transfer coding is one the platform does not take; its name, when known.
HttpResponseContentCoding(Option<String>)
The response’s content coding is one the platform does not take; its name, when known.
HttpResponseTimeout
The response did not arrive in time: its first body byte after the head, or the next one
after the last, took longer than SendOptions::first_byte_timeout or
SendOptions::between_bytes_timeout allowed.
HttpUpgradeFailed
The request’s protocol upgrade failed.
HttpProtocolError
The server spoke something that is not valid HTTP.
LoopDetected
A proxy on the way detected a loop.
ConfigurationError
The platform’s HTTP implementation is not configured to send this request.
Internal(Option<String>)
A failure that fits no other case, with an unstructured description when one is known; WASI warns that the string need not mean the same between implementations.
TooManyRedirects
A redirect policy allowed fewer redirects than the server sent. Not a WASI case: WASI leaves the redirect limit to the application.
Trait Implementations§
impl Eq for HttpError
Source§impl Error for HttpError
impl Error for HttpError
1.30.0 · 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()
impl StructuralPartialEq for HttpError
Auto Trait Implementations§
impl Forget for HttpError
impl Freeze for HttpError
impl Move for HttpError
impl RefUnwindSafe for HttpError
impl Send for HttpErrorwhere
RawVecInner: Send,
impl Sync for HttpErrorwhere
RawVecInner: Sync,
impl Unpin for HttpError
impl UnsafeUnpin for HttpError
impl UnwindSafe for HttpErrorwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.