From 3adf33b567c53e79ce45a36031b29da719fb2377 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 21 Aug 2023 22:14:04 -0300 Subject: sugar: showAggregate: display top-level non-AggregateErrors w/ more detail --- src/util/sugar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit 1.3.0-6-gf8a5