Skip to main content

bamboo_agent/
error.rs

1//! Error types for Bamboo
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum BambooError {
7    #[error("Configuration error: {0}")]
8    Config(String),
9
10    #[error("IO error: {0}")]
11    Io(#[from] std::io::Error),
12
13    #[error("Serialization error: {0}")]
14    Serialization(#[from] serde_json::Error),
15
16    #[error("HTTP server error: {0}")]
17    HttpServer(String),
18
19    #[error("Process management error: {0}")]
20    ProcessManagement(String),
21
22    #[error("Agent error: {0}")]
23    Agent(String),
24
25    #[error("{0}")]
26    Other(#[from] anyhow::Error),
27}
28
29pub type Result<T> = std::result::Result<T, BambooError>;