1use troupekit_agent::AgentError;
2use troupekit_core::error::CoreError;
3
4#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
8#[error("{file}: {field}: {message}")]
9pub struct WorkflowError {
10 pub file: String,
11 pub field: String,
12 pub message: String,
13}
14
15impl WorkflowError {
16 pub fn new(file: &str, field: &str, message: impl Into<String>) -> Self {
20 Self {
21 file: file.to_string(),
22 field: field.to_string(),
23 message: message.into(),
24 }
25 }
26}
27
28#[derive(Debug, Clone, PartialEq, thiserror::Error)]
32pub enum GraphError {
33 #[error(transparent)]
34 Workflow(#[from] WorkflowError),
35 #[error("setup: {0}")]
36 Setup(String),
37 #[error("checkpoint: {0}")]
38 Checkpoint(String),
39 #[error("resume: {0}")]
40 Resume(String),
41 #[error(transparent)]
42 Agent(#[from] AgentError),
43 #[error(transparent)]
44 Store(#[from] CoreError),
45}