#[non_exhaustive]pub enum Error {
Show 18 variants
Io(Error),
Tls(Error),
Record(&'static str),
Ws(&'static str),
Http(String),
Upgrade {
status: u16,
body: String,
retry_after_ms: Option<u64>,
retry_after_invalid: bool,
},
Unanswered(Box<Unanswered>),
CurlResend {
method: String,
},
Closed,
WsClose(Box<Close>),
Config(String),
Unsupported(&'static str),
Dns(String),
Timeout(&'static str),
Busy(&'static str),
QuickAck(Box<QuickAckError>),
Cpu(Box<CpuError>),
HostCheck(Box<HostCheckError>),
}Expand description
An I/O, protocol or configuration error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Operating-system I/O failure.
Tls(Error)
TLS failure reported by rustls.
Record(&'static str)
Record-layer failure (bad record, AEAD failure, unexpected content).
Ws(&'static str)
WebSocket protocol violation.
Http(String)
HTTP failure (a malformed response or upgrade).
Upgrade
The server answered the WebSocket upgrade with status, not 101.
Fields
retry_after_ms: Option<u64>The server’s Retry-After, in ms (see
crate::outcome::retry_after_ms); None without one. Wait at
least this long before connecting again (a 429 or 418 refusal).
Unanswered(Box<Unanswered>)
An HTTP connection closed with requests unanswered. HttpConn users
get it in Handler::on_closed; HttpClient reports each request’s
crate::outcome::Sent to ClientHandler::on_error instead. Boxed:
rare.
CurlResend
The libcurl HttpClient refused method: libcurl sends a request
again, up to 5 times, when the reused connection it went out on dies
before any reply byte, so an order could run twice. Without
HttpClientConfig::curl_allow_non_idempotent_methods it takes only
GET, HEAD, OPTIONS and DELETE. The native client never re-sends.
Closed
The peer closed the connection without a WebSocket close handshake.
WsClose(Box<Close>)
A WebSocket close handshake ended the connection: the code and
reason, and who started it. Boxed: rare, and it keeps Result small.
Config(String)
Bad configuration input.
Unsupported(&'static str)
The backend is not available on this platform or build.
Dns(String)
Name resolution failed.
Timeout(&'static str)
An operation did not finish in time.
Busy(&'static str)
A limit was reached; retry later.
QuickAck(Box<QuickAckError>)
The quick-ACK route check refused the connection
(crate::route::QuickAckCheck::Require). Boxed: it is rare, and
every Result of this crate carries the size of the largest variant.
Cpu(Box<CpuError>)
A helper thread has no CPU it may use (crate::placement): the
process may use the polling CPU only (a pod with one CPU), or a CPU
setting names one outside its cpuset. Boxed: rare.
HostCheck(Box<HostCheckError>)
The host-check switch (ERGON_HOST_CHECKS): it is set to something
other than off, on or require, or it is require and a host
check warned (crate::checks::HostReport::refusal). Boxed: rare.
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()