fix: correctly propagate exit codes without printing them
CI / Clippy (push) Successful in 23s
CI / Format (push) Failing after 10m51s
CI / Check (push) Failing after 12m5s
CI / Test (push) Failing after 13m28s

This commit is contained in:
2026-06-15 17:01:59 +02:00
parent 91d6225946
commit 3a0d78b048
2 changed files with 5 additions and 4 deletions
+2 -3
View File
@@ -183,9 +183,8 @@ fn main() -> Result<()> {
}); });
// Cleanup happens automatically via tempfile // Cleanup happens automatically via tempfile
match &result { if result.is_ok() {
Ok(_) => veprintln!("Cleanup complete."), veprintln!("Cleanup complete.");
Err(e) => eprintln!("Error: {}", e),
} }
result result
+3 -1
View File
@@ -224,10 +224,12 @@ where
match status { match status {
nix::sys::wait::WaitStatus::Exited(_, 0) => Ok(()), nix::sys::wait::WaitStatus::Exited(_, 0) => Ok(()),
nix::sys::wait::WaitStatus::Exited(_, code) => { nix::sys::wait::WaitStatus::Exited(_, code) => {
// If the child reported an error (e.g., setup failure), return it.
// Otherwise, just forward the exit code without an error message.
if let Some(msg) = child_error { if let Some(msg) = child_error {
Err(anyhow!("{}", msg)) Err(anyhow!("{}", msg))
} else { } else {
Err(anyhow!("Child process exited with code {}", code)) std::process::exit(code);
} }
} }
nix::sys::wait::WaitStatus::Signaled(_, sig, _) => { nix::sys::wait::WaitStatus::Signaled(_, sig, _) => {