From 44a4db496d439c73d4655a9e41339ba81f1f958f Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Thu, 5 Oct 2023 16:29:03 +0500 Subject: [PATCH] more errors --- src/util/mod.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/util/mod.rs b/src/util/mod.rs index 7211884..a4e0c8f 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -56,23 +56,27 @@ pub struct RawMedia { // Errors -pub enum GenericError { +pub enum DemuxerError { UnknownSyncByte, FLVUnknownTagType, + FLVCheckFail, + FLVPacketNotMetadata, } -impl Error for GenericError {} +impl Error for DemuxerError {} -impl fmt::Debug for GenericError { +impl fmt::Debug for DemuxerError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - GenericError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"), - GenericError::FLVUnknownTagType => write!(f, "FLV tag does not match expected values") + DemuxerError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"), + DemuxerError::FLVUnknownTagType => write!(f, "FLV tag does not match expected values"), + DemuxerError::FLVCheckFail => write!(f, "Input does not contain assumed FLV signature"), + DemuxerError::FLVPacketNotMetadata => write!(f, "Did not find expected metadata tag") } } } -impl fmt::Display for GenericError { +impl fmt::Display for DemuxerError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(self, f) }