use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("HTTP request failed: {0}")]
Http(#[source] Box<dyn std::error::Error + Send + Sync>),
#[error("HTTP {status}: {body}")]
HttpStatus {
status: u16,
body: String,
},
#[error("failed to build HTTP client: {0}")]
#[cfg(feature = "reqwest")]
HttpClient(#[source] reqwest::Error),
#[error("invalid PDP URL: {0}")]
InvalidPdpUrl(String),
#[error("PDP identifier mismatch: expected `{expected}`, got `{got}`")]
PdpMismatch {
expected: String,
got: String,
},
#[error("PDP not cached: {0}")]
NotCached(String),
#[error("invalid response: {0}")]
InvalidResponse(#[source] serde_json::Error),
#[error("serialization error: {0}")]
Serialization(#[source] serde_json::Error),
}