1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[cfg(any(feature = "async", feature = "blocking"))]
8 #[error("network error fetching {url}")]
9 Fetch {
10 url: String,
11 #[source]
12 source: reqwest::Error,
13 },
14
15 #[error("HTTP {status} from {url}")]
16 Status { url: String, status: u16 },
17
18 #[error("failed to parse masterfile JSON")]
19 Parse(#[from] serde_json::Error),
20
21 #[error("expected JSON array of entries, got something else")]
22 InvalidShape,
23
24 #[error("custom fetcher error")]
25 Custom(#[source] Box<dyn std::error::Error + Send + Sync>),
26}
27
28pub type Result<T> = std::result::Result<T, Error>;