Skip to main content

rinne_types/
error.rs

1//! Shared error and result types used across the Rinne library crates.
2//!
3//! Library crates surface `RinneError` (via `thiserror`); the binary boundary
4//! (`rinne-cli`) wraps these in `anyhow` for top-level reporting.
5
6use std::path::PathBuf;
7
8/// The canonical error type for Rinne's library crates.
9#[derive(Debug, thiserror::Error)]
10pub enum RinneError {
11    #[error("configuration error: {0}")]
12    Config(String),
13
14    #[error("worker error: {0}")]
15    Worker(String),
16
17    #[error("conductor error: {0}")]
18    Conductor(String),
19
20    #[error("mcp error: {0}")]
21    Mcp(String),
22
23    #[error("skill error: {0}")]
24    Skill(String),
25
26    #[error("blackboard error: {0}")]
27    Blackboard(String),
28
29    #[error("plan/DAG error: {0}")]
30    Plan(String),
31
32    /// A run was cancelled (e.g. via `/pause`, a budget kill, or a
33    /// stuck-detector abort).
34    #[error("cancelled: {0}")]
35    Cancelled(String),
36
37    #[error("path not found: {0}")]
38    NotFound(PathBuf),
39
40    #[error("feature not implemented: {0}")]
41    NotImplemented(&'static str),
42
43    #[error(transparent)]
44    Io(#[from] std::io::Error),
45
46    #[error(transparent)]
47    Json(#[from] serde_json::Error),
48}
49
50/// The crate-wide result alias.
51pub type Result<T> = std::result::Result<T, RinneError>;