fix(log): do not log error.Stop messages

This was a regression caused by the new error trace support. Stop errors
indicate an attempt to navigate outside the bounds of the current document
and are not iteresting to log.
This commit is contained in:
CJ van den Berg 2024-07-02 10:11:01 +02:00
parent 9e323fe85e
commit 65f22d8177
3 changed files with 13 additions and 4 deletions

View file

@ -89,7 +89,10 @@ fn process_log(self: *Self, m: tp.message) !void {
if (try m.match(.{ "log", tp.extract(&src), tp.extract(&msg) })) {
try self.set(msg, .info);
} else if (try m.match(.{ "log", "error", tp.extract(&src), tp.extract(&context), "->", tp.extract(&msg) })) {
if (std.mem.eql(u8, msg, "error.Stop"))
const err_stop = "error.Stop";
if (std.mem.eql(u8, msg, err_stop))
return;
if (msg.len >= err_stop.len + 1 and std.mem.eql(u8, msg[0..err_stop.len + 1], err_stop ++ "\n"))
return;
try self.set(msg, .err);
} else if (try m.match(.{ "log", tp.extract(&src), tp.more })) {