#[non_exhaustive]pub enum RagError {
EmptyDocument,
EmptyQuery,
NoDocumentsIndexed,
EmbeddingFailed(String),
DimensionMismatch {
expected: usize,
got: usize,
},
Persistence(String),
NonFinite,
InvalidFilter(String),
Io(Error),
}Expand description
Errors that can occur in the RAG pipeline.
The enum is marked #[non_exhaustive] so that new variants can be added
in patch releases without breaking downstream pattern-matching. Callers
should always include a wildcard (_ => ...) arm when exhaustively
matching on RagError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyDocument
Input document was empty (no text to index).
EmptyQuery
Query string was empty.
NoDocumentsIndexed
Retrieval was attempted before any documents were indexed.
EmbeddingFailed(String)
The embedding backend failed to produce a vector.
DimensionMismatch
A vector was inserted with a dimensionality that does not match the store’s dimension.
Fields
Persistence(String)
A persistence operation (save, load, schema-version check) failed.
NonFinite
A vector or scalar input contained NaN or ±∞. Distance metrics
reject non-finite inputs eagerly rather than silently propagating
poison values through downstream arithmetic.
InvalidFilter(String)
A metadata filter was ill-formed (e.g. empty key, empty In list).
Io(Error)
I/O error (wraps std::io::Error).
Trait Implementations§
Source§impl Error for RagError
impl Error for RagError
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()