pub enum ErrorKind {
Show 17 variants ConnectNotSupported, ConnectError { status_code: StatusCode, body: Vec<u8>, }, Http(Error), Io(Error), InvalidBaseUrl, InvalidUrlHost, InvalidUrlPort, InvalidResponse(InvalidResponseKind), TooManyRedirections, StatusCode(StatusCode), Json(Error), UrlEncoded(Error), Tls(Error), InvalidDNSName(String), InvalidMimeType(String), TlsDisabled, WebPKI(Error),
}
Expand description

Common errors that can occur during HTTP requests.

Variants

ConnectNotSupported

CONNECT is not supported.

ConnectError

Fields

status_code: StatusCode

Status code from the proxy.

body: Vec<u8>

Up to 10 KiB of body data from the proxy which might help diagnose the error.

Could not connect to proxy with CONNECT method.

Http(Error)

Error generated by the http crate.

Io(Error)

IO Error

InvalidBaseUrl

Invalid base URL given to the Request.

InvalidUrlHost

An URL with an invalid host was found while processing the request.

InvalidUrlPort

The URL scheme is unknown and the port is missing.

InvalidResponse(InvalidResponseKind)

Server sent an invalid response.

TooManyRedirections

Too many redirections

StatusCode(StatusCode)

Status code indicates failure

Json(Error)

JSON decoding/encoding error.

UrlEncoded(Error)

Form-URL encoding error.

Tls(Error)

TLS error encountered while connecting to an https server.

InvalidDNSName(String)

Invalid DNS name used for TLS certificate verification

InvalidMimeType(String)

Invalid mime type in a Multipart form

TlsDisabled

TLS was not enabled by features.

WebPKI(Error)

WebPKI error.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.