use std::borrow::Cow;
use lofty_attr::LoftyError;
#[derive(LoftyError)]
#[error(message = "failed to parse picture")]
pub struct PictureParseError {
#[error(from(
std::io::Error,
crate::error::NotEnoughDataError,
crate::error::SizeMismatchError,
crate::error::AllocationError,
crate::util::text::TextDecodingError,
UnknownImageFormatError,
data_encoding::DecodeError,
))]
source: Box<dyn core::error::Error + Send + Sync + 'static>,
}
impl PictureParseError {
pub(super) fn message(message: impl Into<Cow<'static, str>>) -> Self {
let message = message.into();
Self {
source: message.into(),
}
}
}
#[derive(LoftyError)]
#[error(message = "unable to determine image format")]
pub struct UnknownImageFormatError;