« get me outta code hell

html: stack trace layer for Template content compute - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-30 12:37:28 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 12:37:28 -0400
commit07c39b3178b8637099d1ee94dff41d16f8097352 (patch)
tree1e53f8611b296e716ede2a07d6e297f954b07628 /src/util
parent5dd9fa5fb9807b5682b10b8d1f29f90a9ccc42f0 (diff)
html: stack trace layer for Template content compute
Diffstat (limited to 'src/util')
-rw-r--r--src/util/html.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/html.js b/src/util/html.js
index ba31173d..95c5e45b 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -1068,7 +1068,13 @@ export class Template {
       slots[slotName] = this.getSlotValue(slotName);
     }
 
-    return this.description.content(slots);
+    try {
+      return this.description.content(slots);
+    } catch (caughtError) {
+      throw new Error(
+        `Error computing content of ${inspect(this, {compact: true})}`,
+        {cause: caughtError});
+    }
   }
 
   set description(_value) {