summaryrefslogtreecommitdiffstatshomepage
path: root/build.zig
diff options
context:
space:
mode:
authorManlio Perillo <manlio.perillo@gmail.com>2023-05-01 17:32:07 +0200
committerManlio Perillo <manlio.perillo@gmail.com>2023-05-03 18:13:55 +0200
commit40cbee8fa207c4b2d5918741493e015078d9b5fb (patch)
treecb681388804c282e91e887c041a7f37ca03468ce /build.zig
parent27b941fdaf5dbc1311e9ad344a16376bfbcf4013 (diff)
build: fix incorrect error handling in ZiglingStep.compile
When handling the error from the eval method, some possible errors are ignored. The make method will only print the exercise hint and the help message. Print the unexpected error message, in the else prong. Note that FileNotFound can also be considered unexpected.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index 519ab85..03fad4c 100644
--- a/build.zig
+++ b/build.zig
@@ -395,7 +395,16 @@ const ZiglingStep = struct {
for (argv) |v| print("{s} ", .{v});
print("\n", .{});
},
- else => {},
+ else => {
+ print("{s}{s}: Unexpected error: {s}{s}\n", .{
+ red_text,
+ self.exercise.main_file,
+ @errorName(err),
+ reset_text,
+ });
+ for (argv) |v| print("{s} ", .{v});
+ print("\n", .{});
+ },
}
return err;