nt_agentdb_client/
errors.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, AgentDBError>;
4
5#[derive(Debug, Error)]
6pub enum AgentDBError {
7    #[error("Network error: {0}")]
8    Network(String),
9
10    #[error("Authentication failed: {0}")]
11    Auth(String),
12
13    #[error("Not found: {0}")]
14    NotFound(String),
15
16    #[error("Invalid query: {0}")]
17    InvalidQuery(String),
18
19    #[error("Serialization error: {0}")]
20    Serialization(String),
21
22    #[error("Connection error: {0}")]
23    Connection(String),
24
25    #[error("Timeout")]
26    Timeout,
27
28    #[error("Collection not found: {0}")]
29    CollectionNotFound(String),
30
31    #[error("Index error: {0}")]
32    Index(String),
33
34    #[error("HTTP error: {0}")]
35    Http(#[from] reqwest::Error),
36
37    #[error("JSON error: {0}")]
38    Json(#[from] serde_json::Error),
39}