#[non_exhaustive]pub enum KernelError {
LlmApi(String),
RateLimited(u64),
Http {
status: u16,
message: String,
},
Timeout(u64),
Config(String),
Store(String),
Vault(String),
Io(Error),
Search(String),
Embedding(String),
Discovery(String),
Serialization(Error),
}Expand description
Errors that can occur when using llm-kernel.
#[non_exhaustive]: new variants may be added in any minor release. External
matches must include a _ => arm; prefer matching only the variants you
act on (e.g. KernelError::RateLimited / KernelError::Http for retry).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LlmApi(String)
An LLM API returned an error response.
RateLimited(u64)
The LLM API rate-limited the request.
Http
An HTTP error occurred (non-200 status with code).
Timeout(u64)
A request timed out.
Config(String)
A configuration error (missing field, bad format, etc.).
Store(String)
A store (SQLite) error.
Vault(String)
A secrets vault error.
Io(Error)
An I/O error.
Search(String)
A search backend error.
Embedding(String)
An embedding provider or vector-index error.
Discovery(String)
A model-discovery error.
Serialization(Error)
A serialization/deserialization error.
Available whenever any feature that pulls in serde_json is enabled —
not just provider. Add new serde_json-using features to this any(...)
list so a ?-conversion into KernelError keeps compiling everywhere
serde_json is available.
Implementations§
Source§impl KernelError
impl KernelError
Sourcepub fn embedding(e: impl Display) -> Self
pub fn embedding(e: impl Display) -> Self
Construct an KernelError::Embedding from any displayable error.
Convenience for mapping external errors (HTTP clients, ONNX runtimes) at
? sites: .map_err(KernelError::embedding)?.
Sourcepub fn discovery(e: impl Display) -> Self
pub fn discovery(e: impl Display) -> Self
Construct an KernelError::Discovery from any displayable error.
Trait Implementations§
Source§impl Debug for KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
Source§impl Error for KernelError
impl Error for KernelError
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<Error> for KernelError
impl From<Error> for KernelError
Auto Trait Implementations§
impl !RefUnwindSafe for KernelError
impl !UnwindSafe for KernelError
impl Freeze for KernelError
impl Send for KernelError
impl Sync for KernelError
impl Unpin for KernelError
impl UnsafeUnpin for KernelError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more