diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-12 02:12:11 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-12 02:12:11 -0500 |
| commit | 32ea6f54e5f05c4173828c4f4c8ab9965a929120 (patch) | |
| tree | f4c48c5be138070207c19629c08d763c8a6a1325 /std/build.zig | |
| parent | 7ec783876a565662223268a70ba984e0a132b94a (diff) | |
| download | zig-32ea6f54e5f05c4173828c4f4c8ab9965a929120.tar.gz zig-32ea6f54e5f05c4173828c4f4c8ab9965a929120.zip | |
*WIP* proof of concept error return traces
Diffstat (limited to 'std/build.zig')
| -rw-r--r-- | std/build.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/std/build.zig b/std/build.zig index cd6b3811ea..6984715466 100644 --- a/std/build.zig +++ b/std/build.zig @@ -721,11 +721,9 @@ pub const Builder = struct { return error.FileNotFound; } - pub fn exec(self: &Builder, argv: []const []const u8) -> []u8 { + pub fn exec(self: &Builder, argv: []const []const u8) -> %[]u8 { const max_output_size = 100 * 1024; - const result = os.ChildProcess.exec(self.allocator, argv, null, null, max_output_size) catch |err| { - std.debug.panic("Unable to spawn {}: {}", argv[0], @errorName(err)); - }; + const result = try os.ChildProcess.exec(self.allocator, argv, null, null, max_output_size); switch (result.term) { os.ChildProcess.Term.Exited => |code| { if (code != 0) { |
