Enum chttp::error::Error

source ·
pub enum Error {
Show 23 variants BadClientCertificate(Option<String>), BadServerCertificate(Option<String>), Canceled, ConnectFailed, CouldntResolveHost, CouldntResolveProxy, Curl(String), Internal, InvalidContentEncoding(Option<String>), InvalidCredentials, InvalidHttpFormat(Error), InvalidJson, InvalidUtf8, Io(Error), NoResponse, RangeRequestUnsupported, RequestBodyError(Option<String>), ResponseBodyError(Option<String>), SSLConnectFailed(Option<String>), SSLEngineError(Option<String>), Timeout, TooManyConnections, TooManyRedirects,
}
Expand description

All possible types of errors that can be returned from cHTTP.

Variants

BadClientCertificate(Option<String>)

A problem occurred with the local certificate.

BadServerCertificate(Option<String>)

The server certificate could not be validated.

Canceled

The request was canceled before it could be completed.

ConnectFailed

Failed to connect to the server.

CouldntResolveHost

Couldn’t resolve host name.

CouldntResolveProxy

Couldn’t resolve proxy host name.

Curl(String)

An unrecognized error thrown by curl.

Internal

An internal error occurred in the client.

InvalidContentEncoding(Option<String>)

Unrecognized or bad content encoding returned by the server.

InvalidCredentials

Provided credentials were rejected by the server.

InvalidHttpFormat(Error)

Validation error when constructing the request or parsing the response.

InvalidJson

JSON syntax error when constructing or parsing JSON values.

InvalidUtf8

Invalid UTF-8 string error.

Io(Error)

An unknown I/O error.

NoResponse

The server did not send a response.

RangeRequestUnsupported

The server does not support or accept range requests.

RequestBodyError(Option<String>)

An error occurred while writing the request body.

ResponseBodyError(Option<String>)

An error occurred while reading the response body.

SSLConnectFailed(Option<String>)

Failed to connect over a secure socket.

SSLEngineError(Option<String>)

An error ocurred in the secure socket engine.

Timeout

An ongoing request took longer than the configured timeout time.

TooManyConnections

Returned when making more simultaneous requests would exceed the configured TCP connection limit.

TooManyRedirects

Number of redirects hit the maximum amount.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
The lower-level source of this error, if any. Read more
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
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.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Converts the given value to a String. Read more
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.