velesdb_core/agent/
error.rs1use super::snapshot::SnapshotError;
4use thiserror::Error;
5
6#[derive(Debug, Error)]
8#[non_exhaustive]
9pub enum AgentMemoryError {
10 #[error("Failed to initialize memory: {0}")]
12 InitializationError(String),
13
14 #[error("Collection error: {0}")]
16 CollectionError(String),
17
18 #[error("Item not found: {0}")]
20 NotFound(String),
21
22 #[error("Invalid embedding dimension: expected {expected}, got {actual}")]
24 DimensionMismatch {
25 expected: usize,
27 actual: usize,
29 },
30
31 #[error("Database error: {0}")]
33 DatabaseError(#[from] crate::error::Error),
34
35 #[error("Snapshot error: {0}")]
37 SnapshotError(String),
38
39 #[error("IO error: {0}")]
41 IoError(String),
42}
43
44impl From<SnapshotError> for AgentMemoryError {
45 fn from(e: SnapshotError) -> Self {
46 Self::SnapshotError(e.to_string())
47 }
48}
49
50impl From<std::io::Error> for AgentMemoryError {
51 fn from(e: std::io::Error) -> Self {
52 Self::IoError(e.to_string())
53 }
54}