pub struct ProviderFailure {
pub provider_key: ProviderKey,
pub model_key: Option<ModelKey>,
pub code: ProviderFailureCode,
pub retryable: bool,
pub detail: Option<String>,
}Expand description
Normalized description of a provider failure.
The provider crate maps its rich error into this so the core error family stays free of wire types. Never contains raw provider bodies.
Fields§
§provider_key: ProviderKeyProvider identifier.
model_key: Option<ModelKey>Model identifier when known.
code: ProviderFailureCodeNormalized failure code.
retryable: boolWhether the provider crate considers it retryable.
detail: Option<String>The endpoint’s own sentence about the refusal, sanitized by the adapter.
A code says which family a failure belongs to; it cannot say what was
wrong with the request. For the one family where that is the caller’s
own bug — a malformed request — a provider that is down and a function
schema missing properties were indistinguishable from outside, and
telling them apart took a proxy reading a body this library had already
read and discarded.
Absent when the adapter had nothing, and never rendered to a user.
Trait Implementations§
Source§impl Clone for ProviderFailure
impl Clone for ProviderFailure
Source§impl Debug for ProviderFailure
impl Debug for ProviderFailure
Source§impl<'de> Deserialize<'de> for ProviderFailure
impl<'de> Deserialize<'de> for ProviderFailure
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>,
Source§impl Display for ProviderFailure
impl Display for ProviderFailure
impl Eq for ProviderFailure
Source§impl Error for ProviderFailure
impl Error for ProviderFailure
1.30.0 · 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()
Source§impl From<ProviderFailure> for OrchestratorError
impl From<ProviderFailure> for OrchestratorError
Source§fn from(value: ProviderFailure) -> Self
fn from(value: ProviderFailure) -> Self
Source§impl PartialEq for ProviderFailure
impl PartialEq for ProviderFailure
Source§impl Serialize for ProviderFailure
impl Serialize for ProviderFailure
impl StructuralPartialEq for ProviderFailure
Auto Trait Implementations§
impl Freeze for ProviderFailure
impl RefUnwindSafe for ProviderFailure
impl Send for ProviderFailure
impl Sync for ProviderFailure
impl Unpin for ProviderFailure
impl UnsafeUnpin for ProviderFailure
impl UnwindSafe for ProviderFailure
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.