use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("Could not determine cache directory for the current platform")]
CacheDirectoryNotFound,
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Cache entry not found: {0}")]
CacheEntryNotFound(String),
#[error("Invalid cache key: {0}")]
InvalidCacheKey(String),
#[error("Cache corruption detected: {0}")]
CacheCorruption(String),
#[error("Ribbit client error: {0}")]
RibbitClient(#[from] ribbit_client::Error),
#[error("TACT client error: {0}")]
TactClient(#[from] tact_client::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("HTTP request error: {0}")]
Http(#[from] reqwest::Error),
#[error("CDN client error: {0}")]
CdnClient(#[from] ngdp_cdn::Error),
#[error("UTF-8 conversion error: {0}")]
Utf8(#[from] std::string::FromUtf8Error),
#[error("Network error: {0}")]
Network(String),
}