« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/things/validators.js3
-rw-r--r--src/util/sugar.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js
index ba62fb84..bdb22058 100644
--- a/src/data/things/validators.js
+++ b/src/data/things/validators.js
@@ -174,7 +174,8 @@ function validateArrayItemsHelper(itemValidator) {
         throw new Error(`Expected validator to return true`);
       }
     } catch (error) {
-      error.message = `(index: ${colors.yellow(`#${index}`)}, item: ${inspect(item)}) ${error.message}`;
+      error.message = `(index: ${colors.yellow(`${index}`)}, item: ${inspect(item)}) ${error.message}`;
+      error[Symbol.for('hsmusic.decorate.indexInSourceArray')] = index;
       throw error;
     }
   };
diff --git a/src/util/sugar.js b/src/util/sugar.js
index 0522b59e..2e724bae 100644
--- a/src/util/sugar.js
+++ b/src/util/sugar.js
@@ -624,7 +624,7 @@ export function decorateErrorWithIndex(fn) {
       return fn(x, index, array);
     } catch (error) {
       error.message = `(${colors.yellow(`#${index + 1}`)}) ${error.message}`;
-      error[Symbol.for('hsmusic.sugar.index')] = 1;
+      error[Symbol.for('hsmusic.decorate.indexInSourceArray')] = index;
       throw error;
     }
   };