1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Common errors for all CLI commands.
#[derive(Debug, thiserror::Error)]
#[error("Failed to invoke `{command}`")]
pub struct InvocationError {
    #[source]
    pub(crate) source: std::io::Error,
    pub(crate) command: &'static str,
}

#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
#[error("The invocation of `{command}` was terminated by a signal")]
pub struct SignalTermination {
    pub(crate) command: &'static str,
}

#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
#[error("The invocation of `{command}` exited with a non-zero status code: {code}")]
pub struct NonZeroExitCode {
    pub code: i32,
    pub(crate) command: &'static str,
}