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