use thiserror::Error;
#[derive(Error, Debug)]
pub enum MatchyError {
#[error(transparent)]
Paraglob(#[from] matchy_paraglob::error::ParaglobError),
#[error(transparent)]
Format(#[from] matchy_format::FormatError),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("{0}")]
Database(String),
#[error("{0}")]
Validation(String),
}
pub type Result<T> = std::result::Result<T, MatchyError>;
impl From<String> for MatchyError {
fn from(s: String) -> Self {
Self::Database(s)
}
}
impl From<&str> for MatchyError {
fn from(s: &str) -> Self {
Self::Database(s.to_string())
}
}
pub use matchy_format::FormatError;
pub use matchy_paraglob::error::ParaglobError;