use alloc::string::String;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum AmberError {
#[cfg(feature = "std")]
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("Rate limit exceeded. Retry after {0} seconds")]
RateLimitExceeded(u64),
#[error(
"Rate limit exceeded after {attempts} retry attempts. \
Last retry-after: {retry_after} seconds"
)]
RateLimitExhausted {
attempts: u32,
retry_after: u64,
},
#[error("HTTP {status}: {body}")]
UnexpectedStatus {
status: u16,
body: String,
},
}
pub type Result<T> = core::result::Result<T, AmberError>;