Skip to main content

langgraph_core_rs/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum GraphError {
5    #[error("recursion limit exceeded")]
6    RecursionLimit,
7
8    #[error("invalid update for channel '{channel}': {message}")]
9    InvalidUpdate { channel: String, message: String },
10
11    #[error("graph interrupted")]
12    GraphInterrupt,
13
14    #[error("empty channel: {0}")]
15    EmptyChannel(String),
16
17    #[error("node not found: {0}")]
18    NodeNotFound(String),
19
20    #[error("invalid graph: {0}")]
21    InvalidGraph(String),
22
23    #[error("checkpoint error: {0}")]
24    Checkpoint(#[from] langgraph_checkpoint::error::CheckpointError),
25
26    #[error("channel error: {0}")]
27    Channel(#[from] langgraph_checkpoint::error::ChannelError),
28
29    #[error("serialization error: {0}")]
30    Serde(String),
31
32    #[error("io error: {0}")]
33    Io(#[from] std::io::Error),
34
35    #[error("{0}")]
36    Other(String),
37}