turbovault_vector/error.rs
1//! Errors the vector engine returns.
2
3use thiserror::Error;
4
5/// Errors raised by the vector search engine.
6#[derive(Debug, Error)]
7pub enum VectorError {
8 /// The embedding backend failed to load or to embed text.
9 #[error("embedding error: {0}")]
10 Embedding(String),
11 /// The dense (HNSW) or lexical (BM25) index failed a read or write.
12 #[error("index error: {0}")]
13 Index(String),
14 /// A persisted snapshot could not be decoded, or was internally inconsistent.
15 #[error("snapshot error: {0}")]
16 Snapshot(String),
17 /// A configuration value was missing or malformed.
18 #[error("config error: {0}")]
19 Config(String),
20}
21
22/// Result alias for this crate.
23pub type Result<T> = std::result::Result<T, VectorError>;