muster/error.rs
1use thiserror::Error;
2
3use crate::domain::{config::ConfigError, pty::PtyError};
4
5/// Top-level error type for muster.
6///
7/// Domain and adapter modules define their own error enums; this aggregates
8/// them transparently so each error's `Display` speaks for itself.
9#[derive(Debug, Error)]
10pub enum MusterError {
11 /// An I/O failure while driving the terminal or a child process.
12 #[error("i/o error: {0}")]
13 Io(#[from] std::io::Error),
14 /// A workspace configuration failure.
15 #[error(transparent)]
16 Config(#[from] ConfigError),
17 /// A PTY / process-spawning failure.
18 #[error(transparent)]
19 Pty(#[from] PtyError),
20}
21
22/// Crate-wide result alias.
23pub type Result<T> = std::result::Result<T, MusterError>;