use crate::util;
pub type Result<T, E = Error> = core::result::Result<T, E>;
#[derive(thiserror::Error, core::fmt::Debug)]
pub enum Error {
#[error("{0}")]
Custom(String),
#[error("Seed not found: {0}")]
SeedNotFoundError(String),
#[error("Credentials not found: {0}")]
CredentialsNotFoundError(String),
#[error(transparent)]
UtilError(#[from] util::UtilsError),
}
impl Error {
pub fn custom(e: impl std::fmt::Display) -> Error {
Error::Custom(e.to_string())
}
pub fn seed_not_found(e: impl std::fmt::Display) -> Error {
Error::SeedNotFoundError(e.to_string())
}
pub fn credentials_not_found(e: impl std::fmt::Display) -> Error {
Error::CredentialsNotFoundError(e.to_string())
}
}