#[non_exhaustive]pub enum RetrievalError {
Show 15 variants
Hnsw(String),
Bm25(String),
Fusion(String),
GraphTraversal(String),
InvalidQuery(String),
DimensionMismatch {
expected: usize,
actual: usize,
},
Configuration(String),
EmbeddingStore(String),
LinkStore(String),
IndexNotInitialized(String),
RebuildRequired {
reason: String,
},
QueryTimeout {
elapsed_ms: u64,
},
QueryCancelled,
BudgetExceeded {
current_usage: usize,
item_size: usize,
limit: usize,
},
Rerank(String),
}Expand description
Errors that can occur during retrieval operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Hnsw(String)
Vector index operation failed.
Bm25(String)
BM25 index operation failed.
Fusion(String)
Fusion operation failed.
GraphTraversal(String)
Graph traversal failed.
InvalidQuery(String)
Invalid query parameters.
DimensionMismatch
Dimension mismatch.
Configuration(String)
Configuration error.
EmbeddingStore(String)
Embedding store error.
LinkStore(String)
Link store error (for graph operations).
IndexNotInitialized(String)
Index not initialized.
RebuildRequired
Index rebuild required.
QueryTimeout
Query timed out before completing.
The search operation exceeded the configured timeout duration. This is a transient error: the query may succeed with a longer timeout or fewer results requested.
QueryCancelled
Query was cancelled via cancellation token.
The search operation was cancelled before completing. This is a transient error: the query may succeed if not cancelled.
BudgetExceeded
Memory budget exceeded.
The insert operation would cause the index to exceed its configured memory budget. This is a permanent error: the same insert will always fail unless the budget is raised or existing data is removed.
Fields
Rerank(String)
Reranking operation failed (permanent).
Implementations§
Source§impl RetrievalError
impl RetrievalError
Sourcepub fn kind(&self) -> ErrorKind
pub fn kind(&self) -> ErrorKind
Get the error classification (transient or permanent).
This classification determines retry behavior:
Transient: May succeed on retry (network, external services)Permanent: Won’t be fixed by retry (validation, config, data)
§Error Classification Table
| Error Type | Classification | Reason |
|---|---|---|
| EmbeddingStore | Transient | External service, may recover |
| LinkStore | Transient | External service, may recover |
| Hnsw | Permanent | Index algorithm error |
| Bm25 | Permanent | Index algorithm error |
| Fusion | Permanent | Score combination error |
| GraphTraversal | Permanent | Graph algorithm error |
| InvalidQuery | Permanent | User input validation |
| DimensionMismatch | Permanent | Data incompatibility |
| Configuration | Permanent | Setup/config issue |
| IndexNotInitialized | Permanent | Missing prerequisite |
| RebuildRequired | Permanent | Data integrity issue |
| QueryTimeout | Transient | May succeed with longer timeout |
| QueryCancelled | Transient | May succeed if not cancelled |
| BudgetExceeded | Permanent | Capacity limit, won’t auto-resolve |
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check if this error is transient (external/network/contention — may succeed on retry).
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Check if this error is permanent (won’t be fixed by retry).
Permanent errors should be surfaced to the user immediately without retry attempts.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable (alias for is_transient).
Provided for backward compatibility and semantic clarity.
Sourcepub fn graph_traversal(msg: impl Into<String>) -> Self
pub fn graph_traversal(msg: impl Into<String>) -> Self
Create a graph traversal error (permanent).
Sourcepub fn invalid_query(msg: impl Into<String>) -> Self
pub fn invalid_query(msg: impl Into<String>) -> Self
Create an invalid query error (permanent).
Sourcepub fn dimension_mismatch(expected: usize, actual: usize) -> Self
pub fn dimension_mismatch(expected: usize, actual: usize) -> Self
Create a dimension mismatch error (permanent).
Sourcepub fn configuration(msg: impl Into<String>) -> Self
pub fn configuration(msg: impl Into<String>) -> Self
Create a configuration error (permanent).
Sourcepub fn index_not_initialized(msg: impl Into<String>) -> Self
pub fn index_not_initialized(msg: impl Into<String>) -> Self
Create an index not initialized error (permanent).
Sourcepub fn rebuild_required(reason: impl Into<String>) -> Self
pub fn rebuild_required(reason: impl Into<String>) -> Self
Create a rebuild required error (permanent).
Sourcepub fn query_timeout(elapsed_ms: u64) -> Self
pub fn query_timeout(elapsed_ms: u64) -> Self
Create a query timeout error (transient).
Sourcepub fn query_cancelled() -> Self
pub fn query_cancelled() -> Self
Create a query cancelled error (transient).
Sourcepub fn budget_exceeded(
current_usage: usize,
item_size: usize,
limit: usize,
) -> Self
pub fn budget_exceeded( current_usage: usize, item_size: usize, limit: usize, ) -> Self
Create a budget exceeded error (permanent).
Trait Implementations§
Source§impl Debug for RetrievalError
impl Debug for RetrievalError
Source§impl Display for RetrievalError
impl Display for RetrievalError
Source§impl Error for RetrievalError
impl Error for RetrievalError
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()