serenade_console/error.rs
1//! Console errors.
2
3use thiserror::Error;
4
5/// Failures while parsing argv or running a command.
6#[derive(Debug, Error)]
7pub enum ConsoleError {
8 /// Unknown command name.
9 #[error("command `{0}` was not found; run with no arguments to list commands")]
10 NotFound(String),
11 /// Invalid `--env` value.
12 #[error("invalid `--env` value: {0}")]
13 InvalidEnvironment(String),
14 /// Command execution failed.
15 #[error("command failed: {0}")]
16 Failed(String),
17 /// Terminal / TUI I/O failed.
18 #[error("console I/O failed: {0}")]
19 Io(#[from] std::io::Error),
20}