use derive_more::{Display, From};
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Display, From)]
pub enum Error {
#[display("{_0}")]
#[from(String, &String, &str)]
Custom(String),
#[display("Selector '{selector}' is invalid.\nCause: {cause}")]
SelectorParse { selector: String, cause: String },
}
impl Error {
pub fn custom_from_err(err: impl std::error::Error) -> Self {
Self::Custom(err.to_string())
}
pub fn custom(val: impl Into<String>) -> Self {
Self::Custom(val.into())
}
}
impl std::error::Error for Error {}