#[non_exhaustive]pub enum Error {
RateLimited {
retry_after: Option<Duration>,
},
QuotaExhausted {
resets_at: Option<Timestamp>,
},
Network(Source),
Timeout,
Server {
status: u16,
message: Option<String>,
},
CircuitOpen {
until: Option<Timestamp>,
},
AuthRejected {
message: Option<String>,
},
NotFound,
BadRequest(String),
Unsupported(&'static str),
Decode(Source),
InvalidId(IdError),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RateLimited
Too many requests right now; back off and retry.
QuotaExhausted
The provider’s usage budget (e.g. OpenAlex daily credits) is spent.
Not retryable until resets_at; fall back to other providers.
Network(Source)
Timeout
Server
CircuitOpen
The engine’s circuit breaker for this provider is open.
AuthRejected
Credentials missing, invalid or not yet activated. Retrying won’t help.
NotFound
The addressed entity doesn’t exist at this provider. Batch lookups report per-item absence in their result instead.
BadRequest(String)
The provider rejected the request as malformed.
Unsupported(&'static str)
The provider doesn’t offer this operation or identifier kind.
Decode(Source)
The response arrived but couldn’t be understood.
InvalidId(IdError)
Implementations§
Source§impl Error
impl Error
pub fn network(e: impl Error + Send + Sync + 'static) -> Self
pub fn decode(e: impl Error + Send + Sync + 'static) -> Self
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether retrying the same request against the same provider, after backoff, could plausibly succeed.
Sourcepub fn trips_breaker(&self) -> bool
pub fn trips_breaker(&self) -> bool
Whether this failure counts towards opening the circuit breaker. Rate limiting is handled by backoff and does not count.
pub fn category(&self) -> ErrorCategory
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()