pub use container::ContainerError;
mod container;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[cfg(feature = "anyhow")]
#[error(transparent)]
Anyhow(#[from] anyhow::Error),
#[error(transparent)]
Box(#[from] crate::BoxError),
#[error(transparent)]
Container(#[from] ContainerError),
#[error(transparent)]
EnvVar(#[from] std::env::VarError),
#[cfg(feature = "eyre")]
#[error(transparent)]
Eyre(#[from] eyre::Report),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("{0}")]
InvalidArgument(String),
#[cfg(feature = "auth")]
#[error(transparent)]
JsonWebToken(#[from] jsonwebtoken::errors::Error),
#[error("{0}")]
Message(String),
#[cfg(feature = "hash")]
#[error(transparent)]
PasswordHashError(#[from] argon2::password_hash::Error),
#[cfg(feature = "redis")]
#[error(transparent)]
RedisError(#[from] bb8_redis::redis::RedisError),
#[cfg(feature = "redis")]
#[error("redis ping failed")]
RedisPing,
#[cfg(feature = "redis")]
#[error(transparent)]
RedisRunError(#[from] bb8_redis::bb8::RunError<bb8_redis::redis::RedisError>),
#[cfg(feature = "database")]
#[error(transparent)]
SeaOrm(#[from] sea_orm::DbErr),
#[cfg(feature = "storage")]
#[error(transparent)]
Storage(#[from] object_store::Error),
#[cfg(feature = "logger")]
#[error(transparent)]
TracingFilterParseError(#[from] tracing_subscriber::filter::ParseError),
#[cfg(feature = "auth")]
#[error("{0}")]
Unauthorized(String),
}
impl crate::traits::ErrorTrait for Error {}
impl Error {
pub fn message(msg: impl Into<String>) -> Self {
Self::Message(msg.into())
}
}