1#[derive(Debug, thiserror::Error)]
8#[non_exhaustive]
9pub enum Error {
10 #[error("moq: {0}")]
12 Moq(#[from] moq_net::Error),
13
14 #[error("hang: {0}")]
16 Hang(#[from] hang::Error),
17
18 #[error("json: {0}")]
20 Json(#[from] moq_json::Error),
21
22 #[error("cmaf: {0}")]
24 Cmaf(#[from] crate::container::fmp4::Error),
25
26 #[error("mkv: {0}")]
28 Mkv(#[from] crate::container::mkv::Error),
29
30 #[error("msf: {0}")]
32 Msf(#[from] crate::catalog::msf::Error),
33
34 #[error("loc: {0}")]
36 Loc(#[from] moq_loc::Error),
37
38 #[error("annexb: {0}")]
40 Annexb(#[from] crate::codec::annexb::Error),
41
42 #[error("aac: {0}")]
44 Aac(#[from] crate::codec::aac::Error),
45
46 #[error("opus: {0}")]
48 Opus(#[from] crate::codec::opus::Error),
49
50 #[error("h264: {0}")]
52 H264(#[from] crate::codec::h264::Error),
53
54 #[error("h265: {0}")]
56 H265(#[from] crate::codec::h265::Error),
57
58 #[error("av1: {0}")]
60 Av1(#[from] crate::codec::av1::Error),
61
62 #[error("vp8: {0}")]
64 Vp8(#[from] crate::codec::vp8::Error),
65
66 #[error("vp9: {0}")]
68 Vp9(#[from] crate::codec::vp9::Error),
69
70 #[error("legacy: {0}")]
72 Legacy(#[from] crate::codec::legacy::Error),
73
74 #[error("timestamp overflow")]
76 TimestampOverflow(#[from] moq_net::TimeOverflow),
77
78 #[error("mp4: {0}")]
80 Mp4(std::sync::Arc<mp4_atom::Error>),
81
82 #[error("io: {0}")]
84 Io(std::sync::Arc<std::io::Error>),
85
86 #[error("url: {0}")]
88 Url(#[from] url::ParseError),
89
90 #[error("unknown format: {0}")]
92 UnknownFormat(String),
93
94 #[error("{0}")]
97 MissingKeyframe(#[from] crate::container::MissingKeyframe),
98
99 #[error("{0}")]
102 Other(std::sync::Arc<anyhow::Error>),
103
104 #[error("reserved catalog section: {0}")]
107 ReservedSection(String),
108}
109
110impl From<anyhow::Error> for Error {
111 fn from(err: anyhow::Error) -> Self {
112 Error::Other(std::sync::Arc::new(err))
113 }
114}
115
116impl From<mp4_atom::Error> for Error {
117 fn from(err: mp4_atom::Error) -> Self {
118 Error::Mp4(std::sync::Arc::new(err))
119 }
120}
121
122impl From<std::io::Error> for Error {
123 fn from(err: std::io::Error) -> Self {
124 Error::Io(std::sync::Arc::new(err))
125 }
126}
127
128pub type Result<T> = std::result::Result<T, Error>;