pub enum Error {
Connect {
address: SocketAddr,
source: Arc<Error>,
},
Negotiation(NegotiationError),
Closed,
Busy,
Cancelled,
Abandoned,
InvalidOptions,
Unsupported(&'static str),
Pool(Error),
Protocol(Arc<Error>),
Io(Arc<Error>),
Body(BodyError),
}Expand description
A client failure. A request body or interim observer that fails is reported as Body, never as a Protocol error. A response body that fails with a client error reports it as the source of a BodyError, or as the original BodyError when a request body failed.
Negotiation, Pool, Protocol and Body wrap another layer’s error transparently: they display it and report its source. Connect and Io describe the failure and report the I/O error as their source. A cause chain therefore never repeats a message.
Variants§
Connect
Opening the transport to address failed, including the TLS handshake and server verification, so no request was sent. The source can also be a local failure, such as exhausted file descriptors or an invalid TLS server name. Cancellation while connecting, including a caller’s deadline, is Cancelled. A rejected protocol selection is Negotiation, which also precedes any request. With TLS 1.3, a server that rejects the client after the handshake is reported by the first exchange instead.
Negotiation(NegotiationError)
Closed
Busy
Cancelled
Abandoned
InvalidOptions
Unsupported(&'static str)
Pool(Error)
Protocol(Arc<Error>)
Io(Arc<Error>)
Body(BodyError)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()