use thiserror::Error;
#[derive(Debug, Error)]
pub enum PrecolatorError {
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("API error {status}: {message}")]
Api { status: u16, message: String },
#[error("Invalid URL: {0}")]
InvalidUrl(#[from] url::ParseError),
#[error("Serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("Resource not found: {0}")]
NotFound(String),
#[error("Rate limit exceeded — retry after {retry_after_secs}s")]
RateLimited { retry_after_secs: u64 },
}
pub type Result<T> = std::result::Result<T, PrecolatorError>;