use thiserror::Error;
pub type Result<T> = std::result::Result<T, self::Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("{0}")]
Config(#[from] crate::config::Error),
#[error("{0}")]
Fs(#[from] crate::fs::Error),
#[error("{0}")]
Db(#[from] crate::db::Error),
#[error("{0}")]
Io(#[from] std::io::Error),
#[error("{0}")]
Other(#[from] Box<dyn std::error::Error + Send + Sync>),
}
impl Error {
#[inline]
pub fn wrap<E>(err: E) -> Self
where
E: Into<Box<dyn std::error::Error + Send + Sync>>,
{
Self::Other(err.into())
}
}