pub enum ConnectionError {
Show 13 variants
Endpoint(EndpointError),
Codec(CodecError),
Transport(TransportError),
VarInt(VarIntError),
NoControlStream,
UnexpectedEnd,
StreamFinished,
InvalidAddress(String),
TlsConfig(String),
DataStreamState(&'static str),
NonSubscribeNamespaceOnBidiStream(MessageType),
NotOursToAnswer(u64),
ExtensionsOnNonNormalStatus {
object_id: u64,
extensions_len: usize,
status: ObjectStatus,
},
}Expand description
Errors from the connection layer.
Variants§
Endpoint(EndpointError)
Endpoint state machine error.
Codec(CodecError)
Wire codec error.
Transport(TransportError)
Transport-level error.
VarInt(VarIntError)
Variable-length integer decoding error.
NoControlStream
Control stream was not opened.
UnexpectedEnd
Stream ended before a complete message was read.
StreamFinished
Stream was finished by the peer.
InvalidAddress(String)
Invalid server address string.
TlsConfig(String)
TLS configuration error.
DataStreamState(&'static str)
Data stream used out of order (e.g. object before header).
NonSubscribeNamespaceOnBidiStream(MessageType)
A bidirectional stream the peer opened began with a message type other than SUBSCRIBE_NAMESPACE.
Draft-16 Section 3.3: “This specification only specifies two uses of bidirectional streams, the control stream, which begins with CLIENT_SETUP, and SUBSCRIBE_NAMESPACE. Bidirectional streams MUST NOT begin with any other message type unless negotiated. If they do, the peer MUST close the Session with a Protocol Violation.” The session has already been closed on the wire by the time this is returned, and the offending stream reset.
NotOursToAnswer(u64)
A respond_* helper was called on a namespace subscription this
endpoint opened.
The answer to a SUBSCRIBE_NAMESPACE is owed by whoever received it, so
only a stream that arrived through
Connection::accept_namespace_stream can be answered here. Nothing
was written and no state moved.
ExtensionsOnNonNormalStatus
An Object arrived carrying extension headers on a status that is not Normal. Draft-16 Section 10.2.1.2: “Any Object with status Normal can have extension headers”, with a reference to Section 2.5 inside the sentence, and “If an endpoint receives extension headers on Objects with status that is not Normal, it MUST close the session with a PROTOCOL_VIOLATION.”
The codec decodes such an Object rather than refusing it — the frame is well formed, and a tool that reports non-conforming traffic has to be able to read it. Being an endpoint rather than an observer is what turns it into an error, so it is raised here, on the receive path, and not in the decoder.
Connection::close_for_data_stream performs the close the sentence
above requires. It is a separate call because the reader that raises
this holds no connection, and because a deliberately permissive caller
should be able to read a violating stream and report it without tearing
the session down.
Fields
status: ObjectStatusThe Object’s status, resolved through the encoding’s elision rule.
Spelled out in full because the glob import of moqtap_codec::types
brings a different ObjectStatus into this module.
Trait Implementations§
Source§impl Debug for ConnectionError
impl Debug for ConnectionError
Source§impl Display for ConnectionError
impl Display for ConnectionError
Source§impl Error for ConnectionError
impl Error for ConnectionError
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()