From a81d91773beab1447d4e09dd0b6f0f2a4b97e086 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Fri, 8 Mar 2024 17:31:03 +0100 Subject: [PATCH] browser: display js err trace on debug mode --- src/browser/browser.zig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/browser/browser.zig b/src/browser/browser.zig index ed0960ef..33157c0f 100644 --- a/src/browser/browser.zig +++ b/src/browser/browser.zig @@ -385,7 +385,11 @@ pub const Page = struct { if (res.success) { log.debug("eval inline: {s}", .{res.result}); } else { - log.info("eval inline: {s}", .{res.result}); + if (builtin.mode == .Debug and res.stack != null) { + log.info("eval inline: {s}", .{res.stack.?}); + } else { + log.info("eval inline: {s}", .{res.result}); + } } return; @@ -438,7 +442,11 @@ pub const Page = struct { }; } - log.info("eval remote {s}: {s}", .{ src, res.result }); + if (builtin.mode == .Debug and res.stack != null) { + log.info("eval remote {s}: {s}", .{ src, res.stack.? }); + } else { + log.info("eval remote {s}: {s}", .{ src, res.result }); + } return FetchError.JsErr; } }