« 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/util/sugar.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js
index 487c093c..5b1f3193 100644
--- a/src/util/sugar.js
+++ b/src/util/sugar.js
@@ -574,7 +574,12 @@ export function showAggregate(topError, {
     }
   };
 
-  const message = recursive(topError, {level: 0});
+  const message =
+    (topError instanceof AggregateError
+      ? recursive(topError, {level: 0})
+      : (showTraces
+          ? topError.stack
+          : topError.toString()));
 
   if (print) {
     console.error(message);