use std::io;
#[derive(Debug, thiserror::Error)]
pub enum CacheError {
#[error("IO error: {0}")]
Io(#[from] io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("HTTPS required: {0}")]
HttpsRequired(String),
#[error("File size exceeds limit: {size} > {limit}")]
FileTooLarge { size: u64, limit: u64 },
#[error("Too many redirects (max: {max})")]
TooManyRedirects { max: usize },
#[error("Cache entry not found: {0}")]
NotFound(String),
#[error("Offline mode: cache miss for {0}")]
OfflineCacheMiss(String),
#[error("Failed to persist temp file: {0}")]
TempfilePersist(#[from] tempfile::PersistError),
}