1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Debug, Error)]
10pub enum Error {
11 #[error("Could not determine cache directory for the current platform")]
13 CacheDirectoryNotFound,
14
15 #[error("IO error: {0}")]
17 Io(#[from] std::io::Error),
18
19 #[error("Cache entry not found: {0}")]
21 CacheEntryNotFound(String),
22
23 #[error("Invalid cache key: {0}")]
25 InvalidCacheKey(String),
26
27 #[error("Cache corruption detected: {0}")]
29 CacheCorruption(String),
30
31 #[error("Ribbit client error: {0}")]
33 RibbitClient(#[from] ribbit_client::Error),
34
35 #[error("TACT client error: {0}")]
37 TactClient(#[from] tact_client::Error),
38
39 #[error("JSON error: {0}")]
41 Json(#[from] serde_json::Error),
42
43 #[error("HTTP request error: {0}")]
45 Http(#[from] reqwest::Error),
46
47 #[error("CDN client error: {0}")]
49 CdnClient(#[from] ngdp_cdn::Error),
50
51 #[error("UTF-8 conversion error: {0}")]
53 Utf8(#[from] std::string::FromUtf8Error),
54}