« get me outta code hell

write: live-dev-server: use showAggregate more aggressively - 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 00:03:11 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 13:07:03 -0400
commit63a14c5f1714839382568ca259bc96b6a501a088 (patch)
treedeb960ecd779ef1a3655288f85907e9b312695cf
parent9302a8b165f67e8de44300cfda8aa26287e9609a (diff)
write: live-dev-server: use showAggregate more aggressively
-rw-r--r--src/write/build-modes/live-dev-server.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index e2c976b9..2538cb30 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -84,11 +84,14 @@ export async function go({
   niceShowAggregate,
 }) {
   const showError = (error) => {
-    if (error instanceof AggregateError && niceShowAggregate) {
-      niceShowAggregate(error);
-    } else {
-      console.error(inspect(error, {depth: Infinity}));
+    if (niceShowAggregate) {
+      if (error.errors || error.cause) {
+        niceShowAggregate(error);
+        return;
+      }
     }
+
+    console.error(inspect(error, {depth: Infinity}));
   };
 
   const host = cliOptions['host'] ?? defaultHost;