From 94e4b52615777be0991f41075f1e2d758cc3d84b Mon Sep 17 00:00:00 2001 From: hppeng Date: Sun, 26 Jun 2022 05:29:06 -0700 Subject: [PATCH] Print stack visually on error --- builder/index.html | 2 ++ js/builder.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/builder/index.html b/builder/index.html index 1a14ed3..6385eb9 100644 --- a/builder/index.html +++ b/builder/index.html @@ -406,6 +406,8 @@
+
+
diff --git a/js/builder.js b/js/builder.js index 3b6cf33..78e4a99 100644 --- a/js/builder.js +++ b/js/builder.js @@ -443,6 +443,11 @@ function init() { builder_graph_init(); } +window.onerror = function(message, source, lineno, colno, error) { + document.getElementById('err-box').textContent = message; + document.getElementById('stack-box').textContent = error.stack; +}; + (async function() { let load_promises = [ load_init(), load_ing_init(), load_tome_init() ]; await Promise.all(load_promises);