use crate::error::FileParseError;
use crate::file::FileType;
use lofty_attr::LoftyError;
#[derive(LoftyError)]
#[error(message = "failed to parse AAC file")]
pub struct AacParseError {
#[error(from(
std::io::Error,
crate::error::TagParseError,
crate::error::SizeMismatchError,
crate::error::TooMuchDataError,
))]
source: Box<dyn core::error::Error + Send + Sync + 'static>,
}
impl AacParseError {
pub(super) fn message(message: &'static str) -> Self {
Self {
source: message.into(),
}
}
}
impl From<AacParseError> for FileParseError {
fn from(input: AacParseError) -> FileParseError {
Self::new(FileType::Aac, input.source)
}
}