more errors
This commit is contained in:
parent
f9c59a90de
commit
44a4db496d
1 changed files with 10 additions and 6 deletions
|
@ -56,23 +56,27 @@ pub struct RawMedia {
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
|
|
||||||
pub enum GenericError {
|
pub enum DemuxerError {
|
||||||
UnknownSyncByte,
|
UnknownSyncByte,
|
||||||
FLVUnknownTagType,
|
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 {
|
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"),
|
DemuxerError::UnknownSyncByte => write!(f, "sync byte does not match any implemented input format"),
|
||||||
GenericError::FLVUnknownTagType => write!(f, "FLV tag does not match expected values")
|
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 {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
fmt::Debug::fmt(self, f)
|
fmt::Debug::fmt(self, f)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue