vectx_core/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Error, Debug)]
6pub enum Error {
7    #[error("Collection not found: {0}")]
8    CollectionNotFound(String),
9
10    #[error("Collection already exists: {0}")]
11    CollectionExists(String),
12
13    #[error("Invalid vector dimension: expected {expected}, got {actual}")]
14    InvalidDimension { expected: usize, actual: usize },
15
16    #[error("Point not found: {0}")]
17    PointNotFound(String),
18
19    #[error("Point already exists: {0}")]
20    PointExists(String),
21
22    #[error("Storage error: {0}")]
23    Storage(String),
24    
25    #[error("Persistence error: {0}")]
26    Persistence(String),
27
28    #[error("IO error: {0}")]
29    Io(#[from] std::io::Error),
30
31    #[error("Serialization error: {0}")]
32    Serialization(String),
33
34    #[error("Invalid configuration: {0}")]
35    InvalidConfig(String),
36}
37