Skip to main content

moq_rtc/
error.rs

1/// Errors produced by the WebRTC <-> MoQ gateway.
2#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum Error {
5	#[error("invalid SDP: {0}")]
6	InvalidSdp(String),
7
8	#[error("unsupported codec: {0}")]
9	UnsupportedCodec(String),
10
11	#[error("session not found")]
12	SessionNotFound,
13
14	#[error("session closed")]
15	SessionClosed,
16
17	#[error("ICE did not connect before the establishment deadline")]
18	IceTimeout,
19
20	#[error("io error: {0}")]
21	Io(#[from] std::io::Error),
22
23	#[error("moq error: {0}")]
24	Moq(#[from] moq_net::Error),
25
26	#[error("mux error: {0}")]
27	Mux(#[from] moq_mux::Error),
28
29	#[error("rtc error: {0}")]
30	Rtc(#[from] str0m::RtcError),
31
32	#[error("rtc input error: {0}")]
33	RtcInput(#[from] str0m::error::NetError),
34
35	#[error(transparent)]
36	Other(#[from] anyhow::Error),
37}
38
39pub type Result<T> = std::result::Result<T, Error>;