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