authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2021-10-21 10:28:14-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-10-21 17:03:00-04:00
logda2b615efb14f662bf3aac1f9050174966acd17d
tree0d27e073dbc18c7e37fd0a415d98c6827cc8451c
parenta0e195120dd3dd7919fd249a6ce2201da9395898

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.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/build/RunStep.zig+1-1
...@@ -229,7 +229,7 @@ fn make(step: *Step) !void {...@@ -229,7 +229,7 @@ fn make(step: *Step) !void {
229 printCmd(cwd, argv);229 printCmd(cwd, argv);
230 }230 }
231231
232 return error.UncleanExit;232 return error.UnexpectedExitCode;
233 }233 }
234 },234 },
235 else => {235 else => {