From f4da23da2ea895db757c6b93005a2778c62115a3 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Mon, 13 Jul 2026 12:59:29 +0800 Subject: [PATCH] ops: Don't log TryCatchRethrow errors error.TryCatchRethrow is used as a control flow (sorry). It signals that an error has already been throw in v8 and that the method should exit (ultimately, it ends up being the return value passed to our v8 bridge, which knows to ignore it). We shouldn't log this as a WARN, it's completely normal that it happens AND it really contains no meaningful information as-is. --- src/browser/js/Function.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/browser/js/Function.zig b/src/browser/js/Function.zig index 318e45f0f..ee9f2f606 100644 --- a/src/browser/js/Function.zig +++ b/src/browser/js/Function.zig @@ -95,7 +95,11 @@ pub fn call(self: *const Function, comptime T: type, args: anytype) !T { pub fn callRethrow(self: *const Function, comptime T: type, args: anytype) !T { var caught: js.TryCatch.Caught = undefined; return self._tryCallWithThis(T, self.getThis(), args, &caught, .{ .rethrow = true }) catch |err| { - log.warn(.js, "call caught", .{ .err = err, .caught = caught }); + if (err != error.TryCatchRethrow) { + // error.TryCatchRethrow is a control flow (sorry!), not an actual + // error we want to log + log.warn(.js, "call caught", .{ .err = err, .caught = caught }); + } return err; }; }