#[non_exhaustive]pub enum ProviderFailureCode {
Timeout,
RateLimited,
Authentication,
CredentialExpired,
QuotaExhausted,
ContextOverflow,
Malformed,
Refusal,
CapabilityMismatch,
Cancelled,
ServerError,
Other,
}Expand description
Normalized provider failure categories (spec §20.8).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
The request timed out.
RateLimited
The provider rate-limited the request.
Authentication
Authentication failed.
CredentialExpired
A credential that was valid has expired.
Distinct from Authentication because a bad key
stays bad while an expired token becomes valid again after a refresh:
providers that issue short-lived credentials (Vertex AI bearer tokens,
Bedrock session credentials) fail this way as a matter of course, and a
replay record that could not tell the two apart would make a refresh
gap indistinguishable from a misconfiguration.
QuotaExhausted
The account’s quota or credit balance is exhausted.
Distinct from RateLimited because a rate limit
clears by waiting and a quota does not: it clears when a window resets
or a human tops the account up.
ContextOverflow
The prompt exceeded the context window.
Malformed
The response could not be parsed.
Refusal
The model refused.
CapabilityMismatch
The provider/model lacks a required capability (no silent downgrade).
Cancelled
The request was cancelled.
ServerError
The provider returned a server error.
Other
Anything else.
Trait Implementations§
Source§impl Clone for ProviderFailureCode
impl Clone for ProviderFailureCode
impl Copy for ProviderFailureCode
Source§impl Debug for ProviderFailureCode
impl Debug for ProviderFailureCode
Source§impl<'de> Deserialize<'de> for ProviderFailureCode
impl<'de> Deserialize<'de> for ProviderFailureCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ProviderFailureCode
Source§impl Hash for ProviderFailureCode
impl Hash for ProviderFailureCode
Source§impl PartialEq for ProviderFailureCode
impl PartialEq for ProviderFailureCode
Source§impl Serialize for ProviderFailureCode
impl Serialize for ProviderFailureCode
impl StructuralPartialEq for ProviderFailureCode
Auto Trait Implementations§
impl Freeze for ProviderFailureCode
impl RefUnwindSafe for ProviderFailureCode
impl Send for ProviderFailureCode
impl Sync for ProviderFailureCode
impl Unpin for ProviderFailureCode
impl UnsafeUnpin for ProviderFailureCode
impl UnwindSafe for ProviderFailureCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.