New error type

This commit is contained in:
Muaz Ahmad 2023-10-05 15:56:01 +05:00
parent 3aa8cba150
commit 82deae62f5

View file

@ -57,7 +57,8 @@ pub struct RawMedia {
// Errors // Errors
pub enum GenericError { pub enum GenericError {
UnknownSyncByte UnknownSyncByte,
FLVUnknownTagType,
} }
impl Error for GenericError {} impl Error for GenericError {}
@ -66,6 +67,7 @@ impl fmt::Debug for GenericError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
GenericError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"), GenericError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"),
GenericError::FLVUnknownTagType => write!(f, "FLV tag does not match expected values")
} }
} }
} }