diff --git a/crates/gpapi/src/process/auth_launcher.rs b/crates/gpapi/src/process/auth_launcher.rs index c67f939..053c033 100644 --- a/crates/gpapi/src/process/auth_launcher.rs +++ b/crates/gpapi/src/process/auth_launcher.rs @@ -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?; diff --git a/crates/gpapi/src/process/gui_helper_launcher.rs b/crates/gpapi/src/process/gui_helper_launcher.rs index f56a65e..5de0f76 100644 --- a/crates/gpapi/src/process/gui_helper_launcher.rs +++ b/crates/gpapi/src/process/gui_helper_launcher.rs @@ -50,7 +50,11 @@ impl<'a> GuiHelperLauncher<'a> { info!("Launching gpgui-helper"); 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"); }; diff --git a/crates/gpapi/src/process/gui_launcher.rs b/crates/gpapi/src/process/gui_launcher.rs index 3658874..ecbd97e 100644 --- a/crates/gpapi/src/process/gui_launcher.rs +++ b/crates/gpapi/src/process/gui_launcher.rs @@ -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"); }; diff --git a/crates/gpapi/src/process/hip_launcher.rs b/crates/gpapi/src/process/hip_launcher.rs index 02ba227..33db329 100644 --- a/crates/gpapi/src/process/hip_launcher.rs +++ b/crates/gpapi/src/process/hip_launcher.rs @@ -72,10 +72,16 @@ impl<'a> HipLauncher<'a> { cmd.env("APP_VERSION", client_version); } - let output = cmd + let child = cmd .kill_on_drop(true) .stdout(Stdio::piped()) - .spawn()? + .spawn(); + + if child.is_err() { + bail!("Failed to spawn {}: {}", self.program, child.unwrap_err()) + } + + let output = child.unwrap() .wait_with_output() .await?;