#[cfg(feature = "cache")] pub mod cache; #[cfg(feature = "database")] pub mod database; use thiserror::Error; #[derive(Error, Debug)] pub enum ServiceError { #[error("cache error")] #[cfg(feature = "cache")] Cache(#[from] redis::RedisError), #[error("database error")] #[cfg(feature = "database")] Database(#[from] sqlx::Error), #[error("the data for key `{0}` is not available")] Redaction(String), #[error("invalid header (expected {expected:?}, found {found:?})")] InvalidHeader { expected: String, found: String }, #[error("unknown data store error")] Unknown, }