Skip to main content

codemem_core/
error.rs

1/// Unified error type for Codemem.
2#[derive(Debug, thiserror::Error)]
3pub enum CodememError {
4    #[error("Storage error: {0}")]
5    Storage(String),
6
7    #[error("Vector error: {0}")]
8    Vector(String),
9
10    #[error("Graph error: {0}")]
11    Graph(String),
12
13    #[error("Embedding error: {0}")]
14    Embedding(String),
15
16    #[error("MCP error: {0}")]
17    Mcp(String),
18
19    #[error("Hook error: {0}")]
20    Hook(String),
21
22    #[error("Invalid memory type: {0}")]
23    InvalidMemoryType(String),
24
25    #[error("Invalid relationship type: {0}")]
26    InvalidRelationshipType(String),
27
28    #[error("Invalid node kind: {0}")]
29    InvalidNodeKind(String),
30
31    #[error("Not found: {0}")]
32    NotFound(String),
33
34    #[error("Duplicate content (hash: {0})")]
35    Duplicate(String),
36
37    #[error("Internal error: {0}")]
38    Internal(String),
39
40    #[error("Configuration error: {0}")]
41    Config(String),
42
43    #[error("Lock poisoned: {0}")]
44    LockPoisoned(String),
45
46    #[error("IO error: {0}")]
47    Io(#[from] std::io::Error),
48
49    #[error("JSON error: {0}")]
50    Json(#[from] serde_json::Error),
51}