1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Error, Debug)]
10pub enum Error {
11 #[error("Collection '{0}' already exists")]
13 CollectionExists(String),
14
15 #[error("Collection '{0}' not found")]
17 CollectionNotFound(String),
18
19 #[error("Point with ID '{0}' not found")]
21 PointNotFound(u64),
22
23 #[error("Vector dimension mismatch: expected {expected}, got {actual}")]
25 DimensionMismatch {
26 expected: usize,
28 actual: usize,
30 },
31
32 #[error("Invalid vector: {0}")]
34 InvalidVector(String),
35
36 #[error("Storage error: {0}")]
38 Storage(String),
39
40 #[error("Index error: {0}")]
42 Index(String),
43
44 #[error("IO error: {0}")]
46 Io(#[from] std::io::Error),
47
48 #[error("Serialization error: {0}")]
50 Serialization(String),
51
52 #[error("Internal error: {0}")]
54 Internal(String),
55}