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.
This commit is contained in:
Manlio Perillo 2023-05-01 17:32:07 +02:00
parent 68c468df73
commit 3e7320a832

View file

@ -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;