use std::fmt;
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
Parse {
src: String,
source: owned_ttf_parser::FaceParsingError,
},
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Parse { src, source } => {
write!(f, "VectorFont: cannot parse the font {src}: {source}")
}
}
}
}
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Self::Parse { source, .. } => Some(source),
}
}
}