Skip to main content

recall_echo/graph/
error.rs

1//! Typed error handling for recall-graph.
2
3/// All errors that recall-graph operations can produce.
4#[derive(thiserror::Error, Debug)]
5pub enum GraphError {
6    #[error("database: {0}")]
7    Db(#[from] surrealdb::Error),
8
9    #[error("embedding: {0}")]
10    Embed(String),
11
12    #[error("entity not found: {0}")]
13    NotFound(String),
14
15    #[error("extraction failed: {0}")]
16    Extraction(String),
17
18    #[error("dedup failed: {0}")]
19    Dedup(String),
20
21    #[error("llm error: {0}")]
22    Llm(String),
23
24    #[error("parse error: {0}")]
25    Parse(String),
26
27    #[error("io: {0}")]
28    Io(#[from] std::io::Error),
29
30    #[error("json: {0}")]
31    Json(#[from] serde_json::Error),
32
33    #[error("immutable entity cannot be merged: {0}")]
34    ImmutableMerge(String),
35}