Skip to main content

rok_cache/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum CacheError {
5    #[error("cache not configured — add CacheLayer to your router")]
6    NotConfigured,
7    #[error("serialization error: {0}")]
8    Serialize(String),
9    #[error("deserialization error: {0}")]
10    Deserialize(String),
11    #[error("fetch error: {0}")]
12    Fetch(String),
13    #[cfg(feature = "redis")]
14    #[error("redis error: {0}")]
15    Redis(String),
16    #[cfg(feature = "redis")]
17    #[error("CACHE_DRIVER=redis requires REDIS_URL to be set")]
18    MissingRedisUrl,
19}