Skip to content

Commit

Permalink
browser: display js err trace on debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Mar 8, 2024
1 parent 301a1c6 commit a81d917
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/browser/browser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a81d917

Please sign in to comment.