#[non_exhaustive]pub enum ProviderError {
Authentication {
provider: ProviderId,
},
BadRequest {
provider: ProviderId,
message: String,
},
RateLimited {
provider: ProviderId,
retry_after: Option<Duration>,
},
Timeout {
provider: ProviderId,
},
Overloaded {
provider: ProviderId,
},
Unsupported {
provider: ProviderId,
feature: String,
},
Transport {
provider: ProviderId,
source: TransportError,
},
Decode {
provider: ProviderId,
message: String,
},
Provider {
provider: ProviderId,
status: Option<u16>,
message: String,
},
}Expand description
Errors produced by provider implementations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Authentication
Provider credentials were rejected.
Fields
provider: ProviderIdProvider that rejected authentication.
BadRequest
Request payload was invalid for the target provider.
Fields
provider: ProviderIdProvider that rejected the request.
RateLimited
Provider asked the caller to slow down.
Fields
provider: ProviderIdProvider that rate limited the request.
Timeout
Provider call exceeded the configured timeout.
Fields
provider: ProviderIdProvider that timed out.
Overloaded
Provider is temporarily overloaded.
Fields
provider: ProviderIdProvider that reported overload.
Unsupported
Requested provider feature is unavailable.
Fields
provider: ProviderIdProvider that cannot serve the feature.
Transport
Transport layer failed before a provider response was decoded.
Fields
provider: ProviderIdProvider reached by the transport.
source: TransportErrorLower-level HTTP client error.
Decode
Provider response could not be decoded into the neutral schema.
Fields
provider: ProviderIdProvider that returned an invalid response.
Provider
Provider returned a structured error response.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true when retrying the same request may succeed.
Sourcepub fn is_context_overflow(&self) -> bool
pub fn is_context_overflow(&self) -> bool
Returns true when the error indicates the request exceeded the
model’s context window and should be retried after compaction.
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
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()