summaryrefslogtreecommitdiff
path: root/src/host/script.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/script.zig')
-rw-r--r--src/host/script.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/host/script.zig b/src/host/script.zig
index 4563a47..ec716e9 100644
--- a/src/host/script.zig
+++ b/src/host/script.zig
@@ -73,7 +73,11 @@ fn step(host: *Host, arena: std.mem.Allocator, command: []const u8, rest: []cons
} else if (eq(u8, command, "type")) {
for (rest) |byte| try host.route(.{ .kind = .text, .time = now.*, .value = byte });
} else if (eq(u8, command, "console")) {
- host.runLine(rest, now.*);
+ // A failing console line fails the script, like a failed expect.
+ host.runLine(rest, now.*) catch |err| {
+ std.debug.print(" console {s}: {t}\n", .{ rest, err });
+ return err;
+ };
} else if (eq(u8, command, "frames")) {
const count = try std.fmt.parseInt(usize, rest, 10);
for (0..count) |_| try advance(host, now);