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.
- Encode
Error - A failure to build a provider request, returned by
Wire::encode. It converts only intoProviderError::RequestorProviderError::UnsupportedOption, both of kindErrorKind::Request, so every provider classifies its encode failures alike. - Error
Report - A serde-able error crossing a wire boundary.
- Rate
Limits - The allowances a reply’s rate-limit headers state.
Enums§
- Error
Kind - Normalized classification of an
ErrorReport. - Provider
Error - 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§
- BoxError
Non- target_family=wasm - A boxed error:
Send + Syncexcept on wasm. - Shared
Error Non- target_family=wasm - A request-building failure shared by every clone of the error that holds it.