pub enum HttpError {
Show 23 variants
Io(Error),
BadRequestLine,
BadHeader,
UnsupportedVersion,
BadMethod,
BadContentLength,
DuplicateContentLength,
DuplicateTransferEncoding,
BadTransferEncoding,
InvalidHeaderName,
InvalidHeaderValue,
HeadersTooLarge,
TooManyHeaders,
TooManyInformationalResponses {
actual: usize,
limit: usize,
},
RequestLineTooLong,
BadChunkedEncoding,
BodyTooLarge,
BodyTooLargeDetailed {
actual: u64,
limit: u64,
},
BodyCancelled,
BodyChannelClosed,
AmbiguousBodyLength,
TrailersNotAllowed,
PrefetchedDataRemaining(usize),
}Expand description
HTTP/1.1 protocol errors.
Variants§
Io(Error)
An I/O error from the transport.
BadRequestLine
The request line is malformed.
BadHeader
A header line is malformed.
UnsupportedVersion
Unsupported HTTP version in request.
BadMethod
Unrecognised HTTP method.
BadContentLength
Content-Length header is not a valid integer.
DuplicateContentLength
Multiple Content-Length headers present.
DuplicateTransferEncoding
Multiple Transfer-Encoding headers present.
BadTransferEncoding
Transfer-Encoding is present but unsupported.
InvalidHeaderName
Header name contains invalid characters.
InvalidHeaderValue
Header value contains invalid characters.
HeadersTooLarge
Header block exceeds the configured limit.
TooManyHeaders
Too many headers.
TooManyInformationalResponses
Too many informational responses were received before a final response.
Fields
RequestLineTooLong
Request line too long.
BadChunkedEncoding
Incomplete chunked encoding.
BodyTooLarge
Body exceeds the configured limit.
BodyTooLargeDetailed
Body exceeds the configured limit (with size details).
Fields
BodyCancelled
Body stream was cancelled.
BodyChannelClosed
Body channel closed unexpectedly.
AmbiguousBodyLength
Both Content-Length and Transfer-Encoding present (RFC 7230 3.3.3 violation). This is a potential request smuggling vector.
TrailersNotAllowed
Trailers were provided/encountered but are not permitted in this context.
PrefetchedDataRemaining(usize)
Response parsing left unread prefetched bytes when a fully-buffered response API was used.
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
use the Display impl or to_string()