« 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/composite.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/data/composite.js b/src/data/composite.js
index e5873cf5..3dad52f2 100644
--- a/src/data/composite.js
+++ b/src/data/composite.js
@@ -886,7 +886,7 @@ export function compositeFrom(description) {
           }
         });
 
-    withAggregate({message: `Errors in input values provided to ${compositionName}`}, ({push}) => {
+    withAggregate({message: `Errors validating input values provided to ${compositionName}`}, ({push}) => {
       for (const {dynamic, name, value, description} of stitchArrays({
         dynamic: inputsMayBeDynamicValue,
         name: inputNames,
@@ -896,9 +896,10 @@ export function compositeFrom(description) {
         if (!dynamic) continue;
         try {
           validateInputValue(value, description);
-        } catch (error) {
-          error.message = `${name}: ${error.message}`;
-          push(error);
+        } catch (caughtError) {
+          push(new Error(
+            `Error validating input ${name}: ` + inspect(value, {compact: true}),
+            {cause: caughtError}));
         }
       }
     });