#[non_exhaustive]pub enum EmbedError {
Network(String),
Auth(String),
RateLimited(String),
BadRequest {
status: u16,
body: String,
},
Server {
status: u16,
body: String,
},
Decode(String),
DimMismatch {
expected: u32,
got: u32,
},
Config(String),
MissingApiKey {
var: String,
},
}Expand description
Every fallible operation on an crate::Embedder returns this.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network(String)
Network / transport failure: TCP refused, DNS, TLS handshake, read timeout.
Auth(String)
Provider rejected our credentials (HTTP 401 / 403).
RateLimited(String)
Provider rate-limited (HTTP 429). Fail-fast; a retry-with-backoff layer belongs in the caller, not in the adapter.
BadRequest
Client-side 4xx other than 401/403/429 (bad model name, invalid JSON, input too long, …).
Fields
Server
Provider-side 5xx. Treated as transient; caller decides retry.
Decode(String)
Response parsed as JSON but did not match the expected shape.
DimMismatch
Provider returned a vector whose length disagrees with the configured dimension.
Fields
Config(String)
Config is malformed (e.g. unknown model string, invalid URL).
MissingApiKey
The env var named by api_key_env is not set in the process
environment. Surfaced verbatim so the CLI can suggest export.
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
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()