diff --git a/src/main.rs b/src/main.rs index 5133da6..12c0785 100644 --- a/src/main.rs +++ b/src/main.rs @@ -234,7 +234,10 @@ fn runcmd(log: &mut LogFile, argv: &[&str], cwd: &Path) -> Result<(), NativeErro error .to_writer(std::io::stdout()) .map_err(|e| NativeError::WriteResponse(error.clone(), e))?; - return Ok(()); + return Err(NativeError::CommandFailed( + exit.code().unwrap(), + argv.iter().map(|s| s.to_string()).collect(), + )); } Ok(()) } @@ -499,4 +502,7 @@ enum NativeError { #[error("failed to run command {0:?}")] Command(Vec, #[source] std::io::Error), + + #[error("command failed with exit code {0}: {1:?}")] + CommandFailed(i32, Vec), }