#[non_exhaustive]pub enum ProtocolError {
Show 15 variants
EarlyClose,
Parse(String),
HttpParse(String),
MissingHeader(&'static str),
Header(String),
Body(String),
BodyTooLarge {
size: usize,
max: usize,
},
InvalidField {
field: ProtocolField,
value: String,
},
InvalidISTag(String),
Serialization(String),
Utf8(Utf8Error),
FromUtf8(FromUtf8Error),
HeaderName(InvalidHeaderName),
HeaderValue(InvalidHeaderValue),
HeaderToStr(ToStrError),
}Expand description
Wire-protocol failures: parsing, missing/invalid headers, encapsulation, …
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EarlyClose
Peer closed the connection before a full ICAP header block arrived.
Parse(String)
Failed to parse an ICAP message.
HttpParse(String)
Failed to parse an embedded HTTP message.
MissingHeader(&'static str)
Required header was absent.
Header(String)
Malformed header (catch-all). Prefer a more specific variant when possible.
Body(String)
Body-handling error (chunked decoder, dechunking, etc.).
BodyTooLarge
Embedded body exceeded a configured byte limit.
InvalidField
Invalid value for a specific ICAP/HTTP field.
InvalidISTag(String)
ISTag validation failed.
Serialization(String)
Outgoing message could not be serialized.
Utf8(Utf8Error)
Invalid UTF-8 in wire data.
FromUtf8(FromUtf8Error)
Invalid UTF-8 while converting owned bytes into text.
HeaderName(InvalidHeaderName)
Invalid HTTP header name.
HeaderValue(InvalidHeaderValue)
Invalid HTTP header value.
HeaderToStr(ToStrError)
HTTP header value could not be represented as text.
Implementations§
Source§impl ProtocolError
impl ProtocolError
Sourcepub fn invalid(field: ProtocolField, value: impl Into<String>) -> Self
pub fn invalid(field: ProtocolField, value: impl Into<String>) -> Self
Build Self::InvalidField tersely.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
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()