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§
- 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.
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.
- transient_
transport - Classifies
StreamEndedand backendInstanceerrors as retryable. Protocol, header, and content-type errors are not retryable. Errors carrying an HTTP status useretryable_status. This does not guarantee the server has not processed the request.
Type Aliases§
- BoxError
Non- target_family=wasm - A boxed request-building failure.
- Shared
Error Non- target_family=wasm - A request-building failure shared by every clone of the error that holds it.