#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("API returned HTTP {status}: {body}")]
Api {
status: reqwest::StatusCode,
body: String,
},
#[error("failed to deserialize response: {source}")]
Deserialize {
#[source]
source: serde_json::Error,
body: String,
},
#[error("invalid URL: {0}")]
Url(#[from] url::ParseError),
#[error("client configuration error: {0}")]
Config(String),
}
pub type Result<T> = std::result::Result<T, Error>;