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

+8 -2
View File
@@ -177,10 +177,16 @@ impl<'a> SamlAuthLauncher<'a> {
}
let mut non_root_cmd = auth_cmd.into_non_root()?;
let output = non_root_cmd
let child = non_root_cmd
.kill_on_drop(true)
.stdout(Stdio::piped())
.spawn()?
.spawn();
if child.is_err() {
bail!("Failed to spawn {}: {}", program, child.unwrap_err())
}
let output = child.unwrap()
.wait_with_output()
.await?;