use thiserror::Error;
use crate::invocation::Invocation;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum RunCommandError {
#[error("failed to complete the run of the command `{invocation}`")]
#[non_exhaustive]
IncompleteRun {
invocation: Box<Invocation>,
source: std::io::Error,
},
#[error("failed to start the command `{invocation}`")]
#[non_exhaustive]
UnstartableCommand {
invocation: Box<Invocation>,
source: std::io::Error,
},
}
#[cfg(test)]
mod tests {
#![allow(clippy::missing_panics_doc)]
use super::*;
#[test]
fn run_command_error_is_send_and_sync() {
fn assert_send_and_sync<T: Send + Sync>() {}
assert_send_and_sync::<RunCommandError>();
}
#[test]
fn run_command_error_stays_small() {
assert!(size_of::<RunCommandError>() <= 4 * size_of::<usize>());
}
}