Skip to main content

moq_mux/
error.rs

1/// Errors from moq-mux operations.
2///
3/// Most variants are simple delegations to underlying layers — [`moq_lite::Error`] for
4/// transport / pub-sub failures, [`hang::Error`] for catalog/codec parsing, and
5/// [`CmafError`](crate::container::CmafError) for CMAF wire-format problems.
6#[derive(Debug, thiserror::Error)]
7#[non_exhaustive]
8pub enum Error {
9	/// Error from the underlying moq-lite transport.
10	#[error("moq: {0}")]
11	Moq(#[from] moq_lite::Error),
12
13	/// Error from the hang catalog/codec layer.
14	#[error("hang: {0}")]
15	Hang(#[from] hang::Error),
16
17	/// Error parsing or building CMAF moof+mdat fragments.
18	#[error("cmaf: {0}")]
19	Cmaf(#[from] crate::container::CmafError),
20}
21
22/// A Result type alias for moq-mux operations.
23pub type Result<T> = std::result::Result<T, Error>;