pub enum ProtocolError {
Truncated,
BadHexLength,
ReservedLength {
pkt_len: u16,
},
PayloadTooLarge {
len: usize,
max: usize,
},
LineTooLong {
pkt_len: usize,
max: usize,
},
EmptyDataPkt,
TextUtf8,
CapabilityUtf8,
MissingProtocolVersion,
MissingFlush,
UnexpectedSpecial,
}Expand description
Failure while encoding or decoding a claimed protocol helper.
Variants§
Truncated
Input ended before a 4-byte length or before pkt-len payload bytes.
BadHexLength
Length field is not four lowercase hex digits (0-9a-f).
gitprotocol-common replaces ABNF HEXDIG with DIGIT / "a" / … / "f".
ReservedLength
0003 is neither a data pkt-line (pkt-len >= 4) nor a documented special.
Specials are flush 0000 (gitprotocol-common), delim 0001, and
response-end 0002 (gitprotocol-v2).
PayloadTooLarge
Encoded data payload exceeds 65516 bytes (gitprotocol-common).
LineTooLong
Decoded pkt-len exceeds 65520 (gitprotocol-common).
EmptyDataPkt
Helpers do not emit an empty data pkt-line (0004).
gitprotocol-common: implementations SHOULD NOT send "0004".
Parsers still accept it as an empty data payload.
TextUtf8
Text helper received a payload that is not UTF-8.
CapabilityUtf8
v1 capability trailer after NUL is not UTF-8.
MissingProtocolVersion
v2 capability advertisement did not start with version 2.
MissingFlush
v2 capability advertisement did not end with flush-pkt.
UnexpectedSpecial
delim-pkt or response-end-pkt appeared inside a v2 capability advertisement.
gitprotocol-v2 capability-advertisement is version, capability lines, then flush-pkt.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
impl Eq for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · 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()