Skip to main content

moqtap_proxy/
error.rs

1//! Proxy error types.
2
3use moqtap_client::transport::TransportError;
4use moqtap_codec::error::CodecError;
5
6/// Errors from the proxy layer.
7#[derive(Debug, thiserror::Error)]
8pub enum ProxyError {
9    /// Error from the QUIC/WebTransport listener.
10    #[error("listener error: {0}")]
11    Listener(String),
12    /// Error from the underlying transport.
13    #[error("transport error: {0}")]
14    Transport(#[from] TransportError),
15    /// Error decoding a MoQT frame.
16    #[error("codec error: {0}")]
17    Codec(#[from] CodecError),
18    /// Failed to connect to the upstream relay.
19    #[error("upstream connection failed: {0}")]
20    UpstreamConnect(String),
21    /// TLS configuration error.
22    #[error("TLS config error: {0}")]
23    TlsConfig(String),
24    /// Certificate generation error.
25    #[error("certificate generation error: {0}")]
26    CertGen(String),
27    /// Session was closed.
28    #[error("session closed: {0}")]
29    SessionClosed(String),
30    /// Proxy is shutting down.
31    #[error("proxy shutdown")]
32    Shutdown,
33}