mirror of
https://github.com/denoland/deno.git
synced 2024-12-15 03:48:02 -05:00
a87be28a46
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>
9 lines
250 B
TypeScript
9 lines
250 B
TypeScript
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;
|