diff --git a/rs/hang/src/error.rs b/rs/hang/src/error.rs index c6aecc4e0..37d2d601e 100644 --- a/rs/hang/src/error.rs +++ b/rs/hang/src/error.rs @@ -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}")] @@ -14,34 +15,10 @@ pub enum Error { #[error("json error: {0}")] Json(Arc), - /// 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), @@ -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), } diff --git a/rs/libmoq/src/error.rs b/rs/libmoq/src/error.rs index cfb5d4315..a9675a42e 100644 --- a/rs/libmoq/src/error.rs +++ b/rs/libmoq/src/error.rs @@ -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")] diff --git a/rs/moq-lite/src/coding/decode.rs b/rs/moq-lite/src/coding/decode.rs index 8cf3a309b..8467380fa 100644 --- a/rs/moq-lite/src/coding/decode.rs +++ b/rs/moq-lite/src/coding/decode.rs @@ -11,6 +11,7 @@ pub trait Decode: Sized { /// A decode error. #[derive(Error, Debug, Clone)] +#[non_exhaustive] pub enum DecodeError { #[error("short buffer")] Short,