1use thiserror::Error;
2
3use crate::mp4box::BoxType;
4
5#[derive(Error, Debug)]
6pub enum Error {
7 #[error("{0}")]
8 IoError(#[from] std::io::Error),
9 #[error("{0}")]
10 InvalidData(&'static str),
11 #[error("{0} not found")]
12 BoxNotFound(BoxType),
13 #[error("{0} and {1} not found")]
14 Box2NotFound(BoxType, BoxType),
15 #[error("trak[{0}] not found")]
16 TrakNotFound(u32),
17 #[error("trak[{0}].{1} not found")]
18 BoxInTrakNotFound(u32, BoxType),
19 #[error("traf[{0}].{1} not found")]
20 BoxInTrafNotFound(u32, BoxType),
21 #[error("trak[{0}].stbl.{1} not found")]
22 BoxInStblNotFound(u32, BoxType),
23 #[error("trak[{0}].stbl.{1}.entry[{2}] not found")]
24 EntryInStblNotFound(u32, BoxType, u32),
25 #[error("traf[{0}].trun.{1}.entry[{2}] not found")]
26 EntryInTrunNotFound(u32, BoxType, u32),
27 #[error("{0} version {1} is not supported")]
28 UnsupportedBoxVersion(BoxType, u8),
29}