use thiserror::Error;

/// Cache result type.
pub type CacheResult<T> = Result<T, CacheError>;

/// Errors returned by cache backends.
#[derive(Debug, Error)]
pub enum CacheError {
    /// Serialization failed.
    #[error("cache serialization error: {0}")]
    Serde(#[from] serde_json::Error),

    /// Backend operation failed.
    #[error("cache backend error: {0}")]
    Backend(String),
}
