« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/data/yaml.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 10797861..0f7f06f0 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1023,7 +1023,7 @@ export function reportDuplicateDirectories(wikiData) {
   const aggregate = openAggregate({message: `Duplicate directories found`});
   for (const thingDataProp of deduplicateSpec) {
     const thingData = wikiData[thingDataProp];
-    aggregate.nest({message: `Duplicate directories found in ${colors.green('wikiData.' + thingDataProp)}`}, ({call}) => {
+    aggregate.nest({message: `Duplicate directories found in ${colors.green('wikiData.' + thingDataProp)}`}, ({push}) => {
       const directoryPlaces = Object.create(null);
       const duplicateDirectories = new Set();
 
@@ -1049,11 +1049,9 @@ export function reportDuplicateDirectories(wikiData) {
 
       for (const directory of sortedDuplicateDirectories) {
         const places = directoryPlaces[directory];
-        call(() => {
-          throw new Error(
-            `Duplicate directory ${colors.green(directory)}:\n` +
-            places.map(thing => ` - ` + inspect(thing)).join('\n'));
-        });
+        push(new Error(
+          `Duplicate directory ${colors.green(directory)}:\n` +
+          places.map(thing => ` - ` + inspect(thing)).join('\n')));
       }
     });
   }