pub enum SessionError {
WebTransport(Error),
Encode(EncodeError),
Decode(DecodeError),
Version(Versions, Versions),
RoleViolation,
BoundsExceeded(BoundsExceeded),
Duplicate,
Internal,
Serve(ServeError),
WrongSize,
}Variants§
WebTransport(Error)
Encode(EncodeError)
Decode(DecodeError)
Version(Versions, Versions)
RoleViolation
TODO SLG - eventually remove or morph into error for incorrect control message for publisher/subscriber The role negiotiated in the handshake was violated. For example, a publisher sent a SUBSCRIBE, or a subscriber sent an OBJECT.
BoundsExceeded(BoundsExceeded)
Some VarInt was too large and we were too lazy to handle it
Duplicate
A duplicate ID was used
Internal
Serve(ServeError)
WrongSize
Implementations§
Source§impl SessionError
impl SessionError
Sourcepub fn code(&self) -> u64
pub fn code(&self) -> u64
An integer code that is sent over the wire. Returns Session Termination Error Codes per draft-14.
Sourcepub fn unimplemented(feature: &str) -> Self
pub fn unimplemented(feature: &str) -> Self
Helper for unimplemented protocol features Logs a warning and returns a NotImplemented error instead of panicking
Sourcepub fn is_graceful_close(&self) -> bool
pub fn is_graceful_close(&self) -> bool
Returns true if this error represents a graceful connection close.
For WebTransport, a graceful close is a CLOSE_WEBTRANSPORT_SESSION capsule
with code 0. For raw QUIC, it’s APPLICATION_CLOSE with code 0 (NO_ERROR).
Both are normal session termination, not error conditions.
This method checks for:
- WebTransport
Closed(0, _)— web-transport-quinn v0.11+ typically converts HTTP/3-encodedApplicationClosedcodes intoWebTransportError::Closed(code, reason)duringSessionErrorconversion when decoding viaerror_from_http3succeeds - Raw QUIC
ApplicationClosedwith code 0 - The local side closing the connection (
LocallyClosed)
§Implementation Notes
We pattern match on web_transport_quinn::SessionError variants. In v0.11+,
WebTransport graceful closes arrive as WebTransportError::Closed(0, _) because
the crate decodes HTTP/3 error codes at the SessionError level. For raw QUIC
connections, the close code is checked directly on ConnectionError::ApplicationClosed.
Coupling note: This implementation is coupled to web-transport-quinn and
quinn. When transitioning to a different WebTransport backend (e.g., tokio-quiche),
ensure the replacement provides equivalent error introspection, or update this
method to handle the new error types.
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§fn clone(&self) -> SessionError
fn clone(&self) -> SessionError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more