From da2b615efb14f662bf3aac1f9050174966acd17d Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Thu, 21 Oct 2021 10:28:14 -0600 Subject: [PATCH] distinguish between unexpected child process exit code and unclean exit This modifies the error for an unexpected exit code from the ChildProcess of RunStep to be UnexpectedExitCode rather than UncleanExit. This allows the handler of the error to distinguish between an error reported by the ChildProcess, and an error executing the ChildProcess, which is an important dinstinction when it comes to know what information to report to the user. For example, if you have a ChildProcess that you know reports its own errors, an unexpected exit code would mean the error is already reported, but an unclean exit would mean that child process was not able to report any error. --- lib/std/build/RunStep.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/build/RunStep.zig b/lib/std/build/RunStep.zig index 8a21c87f8e..4d366c3cdb 100644 --- a/lib/std/build/RunStep.zig +++ b/lib/std/build/RunStep.zig @@ -229,7 +229,7 @@ fn make(step: *Step) !void { printCmd(cwd, argv); } - return error.UncleanExit; + return error.UnexpectedExitCode; } }, else => {