Skip to main content

issundb_vector/
error.rs

1use thiserror::Error;
2
3/// Structured errors representing all vector search and indexing faults.
4#[derive(Debug, Error)]
5pub enum VectorError {
6    #[error("dimension mismatch: index expects {expected}, got {got}")]
7    DimensionMismatch { expected: usize, got: usize },
8
9    #[error(
10        "vector index already configured ({existing}); cannot change to {requested} while vectors exist, use reindex_vector_index to rebuild under the new configuration"
11    )]
12    AlreadyConfigured { existing: String, requested: String },
13
14    #[error("usearch library fault: {0}")]
15    IndexFault(String),
16
17    #[error("invalid vector configuration: {0}")]
18    InvalidConfig(String),
19
20    #[error("underlying storage error: {0}")]
21    Storage(#[from] issundb_core::Error),
22}