zig

fork of https://codeberg.org/ziglang/zig
Log | Tree | Refs | README | LICENSE

commit da2b615efb14f662bf3aac1f9050174966acd17d (tree)
parent a0e195120dd3dd7919fd249a6ce2201da9395898
Author: Jonathan Marler <johnnymarler@gmail.com>
Date:   Thu, 21 Oct 2021 10:28:14 -0600

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.

Diffstat:
Mlib/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 @@ -229,7 +229,7 @@ fn make(step: *Step) !void { printCmd(cwd, argv); } - return error.UncleanExit; + return error.UnexpectedExitCode; } }, else => {