pub enum EmbeddingErrorKind {
OAuth,
Quota,
SlotExhausted,
BackendMismatch,
ZeroDimension,
Unknown,
}Expand description
GAP-004 (v1.0.88): typed classifier for embedding error messages.
Decomposes the legacy AppError::Embedding(String) payload into a
small enum so the call sites can branch on the cause instead of
repeating msg.contains(...) literals. The classification is purely
lexical (case-insensitive substring match on the error message) — no
I/O, no retries, no telemetry, deterministic and safe under
#[serial_test::serial(env)].
6 variants cover the 5 known discriminators from v1.0.85 (ADR-0043)
plus an Unknown fallback for messages that do not match any marker.
Variants§
OAuth
OAuth token expired or absent; no backend can authenticate.
Quota
OAuth usage quota exhausted on the named backend.
SlotExhausted
LLM slot semaphore exhausted after the backoff window.
BackendMismatch
User-requested backend differs from the one that actually executed.
ZeroDimension
Embedding returned a zero-dimensional vector (structural bug).
Unknown
Message did not match any of the 5 markers above.
Implementations§
Source§impl EmbeddingErrorKind
impl EmbeddingErrorKind
Sourcepub fn classify(msg: &str) -> Self
pub fn classify(msg: &str) -> Self
Classify an embedding error message into a typed kind.
Order of checks matters: OAuth is matched before Quota because
both substrings can co-occur in the same message. SlotExhausted
is checked before Quota because the slot-sema path is more
specific (the LLM never even tried to authenticate). The checks
are case-insensitive so OAuth and oauth both classify to
EmbeddingErrorKind::OAuth.
Trait Implementations§
Source§impl Clone for EmbeddingErrorKind
impl Clone for EmbeddingErrorKind
Source§fn clone(&self) -> EmbeddingErrorKind
fn clone(&self) -> EmbeddingErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EmbeddingErrorKind
Source§impl Debug for EmbeddingErrorKind
impl Debug for EmbeddingErrorKind
Source§impl Display for EmbeddingErrorKind
impl Display for EmbeddingErrorKind
impl Eq for EmbeddingErrorKind
Source§impl PartialEq for EmbeddingErrorKind
impl PartialEq for EmbeddingErrorKind
Source§fn eq(&self, other: &EmbeddingErrorKind) -> bool
fn eq(&self, other: &EmbeddingErrorKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EmbeddingErrorKind
Auto Trait Implementations§
impl Freeze for EmbeddingErrorKind
impl RefUnwindSafe for EmbeddingErrorKind
impl Send for EmbeddingErrorKind
impl Sync for EmbeddingErrorKind
impl Unpin for EmbeddingErrorKind
impl UnsafeUnpin for EmbeddingErrorKind
impl UnwindSafe for EmbeddingErrorKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.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> Pointable for T
impl<T> Pointable for T
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.