use std::io;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] io::Error),
#[error("vendor parser error: {0}")]
Vendor(Box<dyn std::error::Error + Send + Sync + 'static>),
#[error("unsupported or unrecognized format: {0}")]
Format(String),
#[error("conformance violation: {0}")]
Conformance(String),
}
pub type Result<T> = std::result::Result<T, Error>;
impl Error {
pub fn vendor<E>(err: E) -> Self
where
E: std::error::Error + Send + Sync + 'static,
{
Error::Vendor(Box::new(err))
}
}