hydracache_db/error.rs
1use thiserror::Error;
2
3/// Error type returned by database cache adapter helpers.
4#[derive(Debug, Error)]
5pub enum DbCacheError {
6 /// A cached database operation cannot run without an explicit cache key.
7 #[error("database cached operation `{operation}` is missing an explicit cache key")]
8 MissingKey { operation: String },
9
10 /// The underlying HydraCache operation failed.
11 #[error(transparent)]
12 Cache(#[from] hydracache::CacheError),
13}
14
15/// Database cache adapter result type.
16pub type Result<T> = std::result::Result<T, DbCacheError>;