use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum UniRateError {
#[error("Authentication failed: missing or invalid API key")]
Authentication,
#[error("Rate limit exceeded")]
RateLimit,
#[error("Invalid currency: currency not found or no data available")]
InvalidCurrency,
#[error("Invalid date or request parameters")]
InvalidDate,
#[error("API error (status {status}): {body}")]
Api {
status: u16,
body: String,
},
#[error("HTTP transport error: {0}")]
Http(#[from] reqwest::Error),
#[error("JSON decoding error: {0}")]
Json(#[from] serde_json::Error),
}