pub enum RestError {
Io(Error),
Http(HttpError),
BodyTooLarge {
size: usize,
max: usize,
},
RequestTooLarge {
capacity: usize,
},
CrlfInjection,
ConnectionPoisoned,
ReadTimeout,
ConnectionStale,
ConnectionClosed(&'static str),
InvalidUrl(String),
TlsNotEnabled,
Tls(TlsError),
}Expand description
REST client error.
Variants§
Io(Error)
I/O error.
Http(HttpError)
HTTP protocol error.
BodyTooLarge
Response body exceeds max size.
Fields
RequestTooLarge
Request exceeds WriteBuf capacity.
CrlfInjection
Header name/value or query parameter contains CR/LF bytes.
ConnectionPoisoned
Connection is poisoned after an I/O error mid-response.
ReadTimeout
Read timed out waiting for response.
ConnectionStale
Connection is stale (dead socket detected after timeout).
ConnectionClosed(&'static str)
Connection closed before response complete.
InvalidUrl(String)
Invalid URL.
TlsNotEnabled
https:// URL used without the tls feature enabled.
Tls(TlsError)
TLS error during connection setup (handshake, certificate validation, hostname resolution).
Steady-state TLS protocol errors (decrypt failure, peer
alert, malformed record received during a request) on the
async nexus-async-web paths surface as
RestError::Io instead — the underlying
TlsError is wrapped via
io::Error::other and reachable via io_err.source() or
io_err.get_ref(). This asymmetry stems from the
WireStream trait returning io::Result for poll
methods. Sync REST surfaces Tls directly because its
TlsStream exposes TlsError natively. Pattern-match on
both Io and Tls if you need to distinguish TLS-protocol
failures from generic transport failures across both
surfaces.
Trait Implementations§
Source§impl Error for RestError
impl Error for RestError
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()