From a87be28a46b67e53354f8ce69386057ddbb0f46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 16 Apr 2022 16:12:26 +0200 Subject: feat: Better formatting for AggregateError (#14285) This commit adds "aggregated" field to "deno_core::JsError" that stores instances of "JsError" recursively to properly handle "AggregateError" formatting. Appropriate logics was added to "PrettyJsError" and "console" API to format AggregateErrors. Co-authored-by: Nayeem Rahman --- cli/tests/testdata/error_cause_recursive.ts.out | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cli/tests/testdata/error_cause_recursive.ts.out') diff --git a/cli/tests/testdata/error_cause_recursive.ts.out b/cli/tests/testdata/error_cause_recursive.ts.out index 8bfda02fb..ac729574d 100644 --- a/cli/tests/testdata/error_cause_recursive.ts.out +++ b/cli/tests/testdata/error_cause_recursive.ts.out @@ -3,12 +3,8 @@ error: Uncaught Error: bar const y = new Error("bar", { cause: x }); ^ at file:///[WILDCARD]/error_cause_recursive.ts:2:11 -Caused by: Uncaught Error: foo -const x = new Error("foo"); - ^ +Caused by: Error: foo at file:///[WILDCARD]/error_cause_recursive.ts:1:11 -Caused by: Uncaught Error: bar -const y = new Error("bar", { cause: x }); - ^ +Caused by: Error: bar at file:///[WILDCARD]/error_cause_recursive.ts:2:11 -[WILDCARD] \ No newline at end of file +[WILDCARD] -- cgit v1.2.3