« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/index.js')
-rw-r--r--src/content/dependencies/index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/content/dependencies/index.js b/src/content/dependencies/index.js
index 95247e9c..28755f7b 100644
--- a/src/content/dependencies/index.js
+++ b/src/content/dependencies/index.js
@@ -35,6 +35,7 @@ export function watchContentDependencies({
   const contentDependencies = {};
 
   let emittedReady = false;
+  let emittedErrorForFunctions = new Set();
   let closed = false;
 
   let _close = () => {};
@@ -201,7 +202,8 @@ export function watchContentDependencies({
         break main;
       }
 
-      if (logging && emittedReady) {
+      const emittedError = emittedErrorForFunctions.has(functionName);
+      if (logging && (emittedReady || emittedError)) {
         const timestamp = new Date().toLocaleString('en-US', {timeStyle: 'medium'});
         console.log(colors.green(`[${timestamp}] Updated ${functionName}`));
       }
@@ -221,6 +223,7 @@ export function watchContentDependencies({
     }
 
     events.emit('error', functionName, error);
+    emittedErrorForFunctions.add(functionName);
 
     if (logging) {
       if (contentDependencies[functionName]) {