1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum VectorDbError {
6 #[error("failed to connect to Qdrant at '{url}': {message}")]
8 ConnectionFailed {
9 url: String,
11 message: String,
13 },
14
15 #[error("failed to create collection '{collection}': {message}")]
17 CreateCollectionFailed {
18 collection: String,
20 message: String,
22 },
23
24 #[error("collection not found: {collection}")]
26 CollectionNotFound {
27 collection: String,
29 },
30
31 #[error("failed to upsert points to '{collection}': {message}")]
33 UpsertFailed {
34 collection: String,
36 message: String,
38 },
39
40 #[error("failed to search in '{collection}': {message}")]
42 SearchFailed {
43 collection: String,
45 message: String,
47 },
48
49 #[error("invalid vector dimension: expected {expected}, got {actual}")]
51 InvalidDimension {
52 expected: usize,
54 actual: usize,
56 },
57
58 #[error("invalid embedding byte length: expected {expected} bytes, got {actual}")]
60 InvalidEmbeddingBytesLength {
61 expected: usize,
63 actual: usize,
65 },
66
67 #[error("failed to delete points from '{collection}': {message}")]
69 DeleteFailed {
70 collection: String,
72 message: String,
74 },
75}