Skip to main content

Module error

Module error 

Source
Expand description

The provider error type, serializable error reports, and shared retry classifications for the effect protocol. Reports preserve classifications, available provider metadata, and textual source chains.

use rig_core::error::{ErrorKind, ProviderError};

let error = ProviderError::from_http_response(http::StatusCode::TOO_MANY_REQUESTS, "slow down");
assert!(error.is_retryable());
assert_eq!(error.report().kind, ErrorKind::ProviderResponse);

Structs§

Allowance
One allowance as a reply states it.
EncodeError
A failure to build a provider request, returned by Wire::encode. It converts only into ProviderError::Request or ProviderError::UnsupportedOption, both of kind ErrorKind::Request, so every provider classifies its encode failures alike.
ErrorReport
A serde-able error crossing a wire boundary.
RateLimits
The allowances a reply’s rate-limit headers state.

Enums§

ErrorKind
Normalized classification of an ErrorReport.
ProviderError
A failed provider operation: completion, embedding, reranking, transcription, image or audio generation, verification, model listing, or context caching.

Functions§

retryable_status
The one status → retryable table.

Type Aliases§

BoxErrorNon-target_family=wasm
A boxed error: Send + Sync except on wasm.
SharedErrorNon-target_family=wasm
A request-building failure shared by every clone of the error that holds it.