Skip to main content

ralph_proto/
error.rs

1//! Error types for the Ralph Orchestrator framework.
2
3use thiserror::Error;
4
5/// Errors that can occur in the Ralph Orchestrator.
6#[derive(Debug, Error)]
7pub enum Error {
8    #[error("Invalid topic pattern: {0}")]
9    InvalidTopic(String),
10
11    #[error("Hat not found: {0}")]
12    HatNotFound(String),
13
14    #[error("Event parse error: {0}")]
15    EventParse(String),
16
17    #[error("CLI execution error: {0}")]
18    CliExecution(String),
19
20    #[error("Configuration error: {0}")]
21    Config(String),
22
23    #[error("IO error: {0}")]
24    Io(#[from] std::io::Error),
25
26    #[error("Loop terminated: {0}")]
27    LoopTerminated(String),
28}
29
30/// Result type alias using our Error type.
31pub type Result<T> = std::result::Result<T, Error>;