velesdb_core/agent/
error.rs1#![allow(missing_docs)] use super::snapshot::SnapshotError;
5use thiserror::Error;
6
7#[derive(Debug, Error)]
8pub enum AgentMemoryError {
9 #[error("Failed to initialize memory: {0}")]
10 InitializationError(String),
11
12 #[error("Collection error: {0}")]
13 CollectionError(String),
14
15 #[error("Item not found: {0}")]
16 NotFound(String),
17
18 #[error("Invalid embedding dimension: expected {expected}, got {actual}")]
19 DimensionMismatch { expected: usize, actual: usize },
20
21 #[error("Database error: {0}")]
22 DatabaseError(#[from] crate::error::Error),
23
24 #[error("Snapshot error: {0}")]
25 SnapshotError(String),
26
27 #[error("IO error: {0}")]
28 IoError(String),
29}
30
31impl From<SnapshotError> for AgentMemoryError {
32 fn from(e: SnapshotError) -> Self {
33 Self::SnapshotError(e.to_string())
34 }
35}
36
37impl From<std::io::Error> for AgentMemoryError {
38 fn from(e: std::io::Error) -> Self {
39 Self::IoError(e.to_string())
40 }
41}