1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Error, Debug)]
10pub enum Error {
11 #[error("Index creation failed: {0}")]
13 IndexCreation(String),
14
15 #[error("Search failed: {0}")]
17 Search(String),
18
19 #[error("IO error: {0}")]
21 Io(#[from] std::io::Error),
22
23 #[error("JSON error: {0}")]
25 Json(#[from] serde_json::Error),
26
27 #[error("Shape error: {0}")]
29 Shape(String),
30
31 #[error("Index load failed: {0}")]
33 IndexLoad(String),
34
35 #[error("Codec error: {0}")]
37 Codec(String),
38
39 #[error("Invalid configuration: {0}")]
41 Config(String),
42
43 #[error("Update failed: {0}")]
45 Update(String),
46
47 #[error("Delete failed: {0}")]
49 Delete(String),
50
51 #[cfg(feature = "filtering")]
53 #[error("Filtering error: {0}")]
54 Filtering(String),
55
56 #[cfg(feature = "filtering")]
58 #[error("SQLite error: {0}")]
59 Sqlite(#[from] rusqlite::Error),
60
61 #[cfg(feature = "npy")]
63 #[error("NPY read error: {0}")]
64 NpyRead(#[from] ndarray_npy::ReadNpyError),
65
66 #[cfg(feature = "npy")]
68 #[error("NPY write error: {0}")]
69 NpyWrite(#[from] ndarray_npy::WriteNpyError),
70}