pub type DbResult<T> = Result<T, DbError>;
pub type HandlerResult<T> = Result<T, HandlerError>;
#[derive(Debug, thiserror::Error)]
pub enum HandlerError {
#[error("Database connection error: {0}")]
Generic(Box<dyn std::error::Error + Send + Sync>),
#[error("Not supported: {0}")]
NotSupported(String),
}
#[derive(Debug, thiserror::Error)]
pub enum DbError {
#[error("Database connection error: {0}")]
Generic(Box<dyn std::error::Error + Send + Sync>),
#[error("Not found: {0}")]
NotFound(String),
#[error("Already exists: {0}")]
AlreadyExists(String),
}