pub struct EmbedError {
pub source: AppError,
pub retry_class: AttemptOutcome,
}Expand description
OpenRouterClient::embed_single / OpenRouterClient::embed_batch
failure (reauditor addendum, mirrors crate::chat_api::ChatError).
retry_class is the retry verdict computed AT THE ORIGIN (the exact HTTP
status, or the provider’s structured error code) via the same
[crate::openrouter_http::status_retry_class] /
[crate::openrouter_http::provider_error_retry_class] classifiers
crate::chat_api::OpenRouterChatClient uses (GAP-SG-74 DRY) — never
inferred downstream from source.to_string(). The enrich re-embed
consumer reads this field directly instead of pattern-matching the
formatted message.
Fields§
§source: AppErrorUnderlying cause, preserved via source() rather than restated.
retry_class: AttemptOutcomeTyped retry verdict computed where the failure originated (HTTP
status / provider code), not by matching source’s message.
Trait Implementations§
Source§impl Debug for EmbedError
impl Debug for EmbedError
Source§impl Display for EmbedError
impl Display for EmbedError
Source§impl Error for EmbedError
impl Error for EmbedError
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<AppError> for EmbedError
Converts a bare AppError into an EmbedError with retry_class: HardFailure. Used by the ? operator on call sites that predate the
origin-typed classification (the GAP-SG-02 oversized-input guard, the
dimension-mismatch guard in OpenRouterClient::truncate_embedding, and
the batch-size-mismatch check) — all of those are genuine permanent
client/config errors, never transient. Every EmbedError constructed
inside execute_with_retry uses EmbedError::new explicitly with a
retry verdict computed at the exact HTTP status / provider code instead.
impl From<AppError> for EmbedError
Converts a bare AppError into an EmbedError with retry_class: HardFailure. Used by the ? operator on call sites that predate the
origin-typed classification (the GAP-SG-02 oversized-input guard, the
dimension-mismatch guard in OpenRouterClient::truncate_embedding, and
the batch-size-mismatch check) — all of those are genuine permanent
client/config errors, never transient. Every EmbedError constructed
inside execute_with_retry uses EmbedError::new explicitly with a
retry verdict computed at the exact HTTP status / provider code instead.
Source§impl From<EmbedError> for AppError
Unwraps EmbedError back down to its source, discarding retry_class.
Lets the many pre-existing ?-based callers of OpenRouterClient::embed_single
/ OpenRouterClient::embed_batch (in crate::embedder) keep compiling
unchanged; callers that need the typed retry verdict (the enrich
re-embed path) should match on EmbedError directly instead of relying
on this conversion.
impl From<EmbedError> for AppError
Unwraps EmbedError back down to its source, discarding retry_class.
Lets the many pre-existing ?-based callers of OpenRouterClient::embed_single
/ OpenRouterClient::embed_batch (in crate::embedder) keep compiling
unchanged; callers that need the typed retry verdict (the enrich
re-embed path) should match on EmbedError directly instead of relying
on this conversion.
Source§fn from(err: EmbedError) -> Self
fn from(err: EmbedError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for EmbedError
impl !UnwindSafe for EmbedError
impl Freeze for EmbedError
impl Send for EmbedError
impl Sync for EmbedError
impl Unpin for EmbedError
impl UnsafeUnpin for EmbedError
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<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.