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("flac: {0}")]
52 Flac(#[from] crate::codec::flac::Error),
53
54 #[error("mp3: {0}")]
56 Mp3(#[from] crate::codec::mp3::Error),
57
58 #[error("h264: {0}")]
60 H264(#[from] crate::codec::h264::Error),
61
62 #[error("h265: {0}")]
64 H265(#[from] crate::codec::h265::Error),
65
66 #[error("av1: {0}")]
68 Av1(#[from] crate::codec::av1::Error),
69
70 #[error("vp8: {0}")]
72 Vp8(#[from] crate::codec::vp8::Error),
73
74 #[error("vp9: {0}")]
76 Vp9(#[from] crate::codec::vp9::Error),
77
78 #[error("legacy: {0}")]
80 Legacy(#[from] crate::codec::legacy::Error),
81
82 #[error("timestamp overflow")]
84 TimestampOverflow(#[from] moq_net::TimeOverflow),
85
86 #[error("mp4: {0}")]
88 Mp4(std::sync::Arc<mp4_atom::Error>),
89
90 #[error("io: {0}")]
92 Io(std::sync::Arc<std::io::Error>),
93
94 #[error("url: {0}")]
96 Url(#[from] url::ParseError),
97
98 #[error("unknown format: {0}")]
100 UnknownFormat(String),
101
102 #[error("{0}")]
105 MissingKeyframe(#[from] crate::container::MissingKeyframe),
106
107 #[error("{0}")]
110 Other(std::sync::Arc<anyhow::Error>),
111
112 #[error("reserved catalog section: {0}")]
115 ReservedSection(String),
116}
117
118impl From<anyhow::Error> for Error {
119 fn from(err: anyhow::Error) -> Self {
120 Error::Other(std::sync::Arc::new(err))
121 }
122}
123
124impl From<mp4_atom::Error> for Error {
125 fn from(err: mp4_atom::Error) -> Self {
126 Error::Mp4(std::sync::Arc::new(err))
127 }
128}
129
130impl From<std::io::Error> for Error {
131 fn from(err: std::io::Error) -> Self {
132 Error::Io(std::sync::Arc::new(err))
133 }
134}
135
136pub type Result<T> = std::result::Result<T, Error>;