« 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/things/validators.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js
index d881aac2..7289b6d7 100644
--- a/src/data/things/validators.js
+++ b/src/data/things/validators.js
@@ -402,7 +402,9 @@ export function validateAllPropertyValues(validator) {
           try {
             validator(value);
           } catch (error) {
-            error.message = `(key: ${colors.green(key)}, value: ${inspect(value)}) ${error.message}`;
+            const keyPart = colors.green(key.toString());
+            const valuePart = inspect(value);
+            error.message = `(key: ${keyPart}, value: ${valuePart}) ${error.message}`;
             throw error;
           }
         });