fix: correctly propagate exit codes without printing them
This commit is contained in:
+2
-3
@@ -183,9 +183,8 @@ fn main() -> Result<()> {
|
||||
});
|
||||
|
||||
// Cleanup happens automatically via tempfile
|
||||
match &result {
|
||||
Ok(_) => veprintln!("Cleanup complete."),
|
||||
Err(e) => eprintln!("Error: {}", e),
|
||||
if result.is_ok() {
|
||||
veprintln!("Cleanup complete.");
|
||||
}
|
||||
|
||||
result
|
||||
|
||||
+3
-1
@@ -224,10 +224,12 @@ where
|
||||
match status {
|
||||
nix::sys::wait::WaitStatus::Exited(_, 0) => Ok(()),
|
||||
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 {
|
||||
Err(anyhow!("{}", msg))
|
||||
} else {
|
||||
Err(anyhow!("Child process exited with code {}", code))
|
||||
std::process::exit(code);
|
||||
}
|
||||
}
|
||||
nix::sys::wait::WaitStatus::Signaled(_, sig, _) => {
|
||||
|
||||
Reference in New Issue
Block a user