use std::process::ExitStatus;
#[cfg(doc)]
use crate::RootlessBackend;
use crate::utils::SystemdDetectVirtOutput;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Unable to to find executable: \"{executable}\"")]
ExecutableNotFound {
executable: String,
source: which::Error,
},
#[error("The command \"{command}\" could not be executed:\n{source}")]
CommandExec {
command: String,
source: std::io::Error,
},
#[error(
"The command \"{command}\" exited with non-zero status code \"{exit_status}\":\nstderr:\n{stderr}"
)]
CommandNonZero {
command: String,
exit_status: ExitStatus,
stderr: String,
},
#[error("Unknown output of \"systemd-detect-virt\": \"{output}\"")]
UnknownSystemdDetectVirtOutput {
output: String,
},
#[error(
"Rootless backends based on kernel namespaces are not supported in the \"{runtime}\" containerization runtime."
)]
NamespacesInContainer {
runtime: SystemdDetectVirtOutput,
},
}