#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("rate limit exceeded: {message}")]
RateLimit {
message: String,
},
#[error("not found: {message}")]
NotFound {
message: String,
},
#[error("authentication failed: {message}")]
Authentication {
message: String,
},
#[error("validation error: {message}")]
Validation {
message: String,
},
#[error("network error: {source}")]
Network {
#[from]
source: reqwest::Error,
},
#[error("API error (status {status_code}): {message}")]
Api {
status_code: u16,
message: String,
},
}
pub type Result<T> = std::result::Result<T, Error>;