pub enum ProviderError {
Http {
context: String,
source: Error,
},
Serde {
context: String,
source: Error,
},
Io {
context: String,
source: Error,
},
Config(String),
Logic(String),
}Expand description
Errors produced by AI provider implementations and the shared tool loop.
Variants§
Http
HTTP transport failure — request build, network error, timeout.
context describes the operation; source is the reqwest::Error.
Fields
Serde
JSON serialization or deserialization failed.
Fields
Io
A filesystem operation failed.
Fields
Config(String)
Missing or invalid configuration — env var unset, bad model id, etc.
Logic(String)
Domain-logic error with no foreign source — provider rejected the request, retries exhausted, response shape mismatch, etc.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn http(context: impl Into<String>, source: Error) -> Self
pub fn http(context: impl Into<String>, source: Error) -> Self
Wrap a reqwest::Error with operation context.
Sourcepub fn serde(context: impl Into<String>, source: Error) -> Self
pub fn serde(context: impl Into<String>, source: Error) -> Self
Wrap a serde_json::Error with operation context.
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()
Source§impl From<ProviderError> for KernexError
Bridge to the workspace-level aggregate error.
impl From<ProviderError> for KernexError
Bridge to the workspace-level aggregate error.
Boxes the typed ProviderError inside KernexError::Provider so callers
downstream can recover the structured cause via
boxed.downcast_ref::<ProviderError>(). Config is hoisted to the
dedicated KernexError::Config variant since it’s a configuration
failure, not a provider failure.
Source§fn from(err: ProviderError) -> Self
fn from(err: ProviderError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ProviderError
impl !UnwindSafe for ProviderError
impl Freeze for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.