« get me outta code hell

infra: report who sourced unfulfilled relations - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-02 09:30:20 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-02 09:30:20 -0300
commite09e11f1b933fa67f07c9f5e4340466f89672c8b (patch)
tree615c9b766bff08c925f75bfc0dc33ddedcb3358c /src/write
parentd646ae0de00aebefb15faedfbdfe9995e2250b17 (diff)
infra: report who sourced unfulfilled relations
Diffstat (limited to 'src/write')
-rw-r--r--src/write/build-modes/live-dev-server.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index 10b40cf..3d29a83 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -33,6 +33,7 @@ import {
   flattenRelationsTree,
   getRelationsTree,
   getNeededContentDependencyNames,
+  sourceAnnotation,
 } from '../../content-function.js';
 
 const defaultHost = '0.0.0.0';
@@ -429,11 +430,16 @@ export async function go({
 
       const slotResults = {};
 
-      function runContentFunction({name, args, relations: flatRelations}) {
+      function runContentFunction({
+        name,
+        args,
+        relations: flatRelations,
+        [sourceAnnotation]: sourceName,
+      }) {
         const contentFunction = fulfilledContentDependencies[name];
 
         if (!contentFunction) {
-          throw new Error(`Content function ${name} unfulfilled or not listed`);
+          throw new Error(`Content function ${name} unfulfilled or not listed (from ${sourceName})`);
         }
 
         const sprawl =