Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions rs/hang/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::sync::Arc;
/// This enum represents all possible errors that can occur when working with
/// hang media streams, codecs, and containers.
#[derive(Debug, thiserror::Error, Clone)]
#[non_exhaustive]
pub enum Error {
/// An error from the underlying MoQ transport layer.
#[error("moq lite error: {0}")]
Expand All @@ -14,34 +15,10 @@ pub enum Error {
#[error("json error: {0}")]
Json(Arc<serde_json::Error>),

/// Attempted to add a track that already exists in the catalog.
#[error("duplicate track")]
DuplicateTrack,

/// Referenced track was not found in the catalog.
#[error("missing track")]
MissingTrack,

/// The provided session ID is invalid or malformed.
#[error("invalid session ID")]
InvalidSession,

/// Attempted to process an empty group (no frames).
#[error("empty group")]
EmptyGroup,

/// The specified codec is invalid or malformed.
#[error("invalid codec")]
InvalidCodec,

/// The frame data is invalid or corrupted.
#[error("invalid frame")]
InvalidFrame,

/// The codec is not supported by this implementation.
#[error("unsupported codec")]
UnsupportedCodec,

/// Failed to parse an integer value.
#[error("expected int")]
ExpectedInt(#[from] std::num::ParseIntError),
Expand All @@ -66,6 +43,7 @@ pub enum Error {
#[error("url parse error: {0}")]
Url(#[from] url::ParseError),

/// The format is not recognized.
#[error("unknown format: {0}")]
UnknownFormat(String),
}
Expand Down
1 change: 1 addition & 0 deletions rs/libmoq/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub type Status = i32;
/// Each error variant maps to a specific negative error code
/// returned to C callers.
#[derive(Debug, thiserror::Error, Clone)]
#[non_exhaustive]
pub enum Error {
/// Resource was closed.
#[error("closed")]
Expand Down
1 change: 1 addition & 0 deletions rs/moq-lite/src/coding/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub trait Decode<V>: Sized {

/// A decode error.
#[derive(Error, Debug, Clone)]
#[non_exhaustive]
pub enum DecodeError {
#[error("short buffer")]
Short,
Expand Down
Loading