« get me outta code hell

validators: fix validateAllPropertyValues messaging - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-30 09:52:52 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:35 -0400
commit97d62ac87cd8e8788cb6b04c62160aab623026c0 (patch)
tree67d9bc707f5f80fc8cace65e555566420ee93768
parent7f39e10beee71ea0c45db3ff9b2f6d6ae383bd3b (diff)
validators: fix validateAllPropertyValues messaging
-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;
           }
         });