mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 21:24:48 +00:00
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 <nayeemrmn99@gmail.com>
This commit is contained in:
parent
0bb96cde72
commit
a87be28a46
10 changed files with 210 additions and 78 deletions
9
cli/tests/testdata/aggregate_error.ts
vendored
Normal file
9
cli/tests/testdata/aggregate_error.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
const aggregateError = new AggregateError([
|
||||
new Error("Error message 1."),
|
||||
new Error("Error message 2."),
|
||||
], "Multiple errors.");
|
||||
console.log(aggregateError.stack);
|
||||
console.log();
|
||||
console.log(aggregateError);
|
||||
console.log();
|
||||
throw aggregateError;
|
Loading…
Add table
Add a link
Reference in a new issue