fix: better error messages when spawning a child program fails

This commit is contained in:
Mark Sheppard authored and Mark Sheppard committed 2026-04-16 00:44:38 +01:00
1 parent 65a93041aa
commit e4426df6a2
4 files changed
+26 -6

No files matched your search

+5 -1
View File
@@ -69,7 +69,11 @@ impl<'a> GuiLauncher<'a> {
info!("Launching gpgui");
let mut non_root_cmd = cmd.into_non_root()?;
let mut child = non_root_cmd.kill_on_drop(true).stdin(Stdio::piped()).spawn()?;
let result = non_root_cmd.kill_on_drop(true).stdin(Stdio::piped()).spawn();
if result.is_err() {
bail!("Failed to spawn {}: {}", self.program.display(), result.unwrap_err())
}
let mut child = result.unwrap();
let Some(mut stdin) = child.stdin.take() else {
bail!("Failed to open stdin");
};