inspect: print individual AggregateError.errors
#43645
Closed
Description
What is the problem this feature will solve?
> (() => {
throw new AggregateError([
new TypeError('blep'),
new RangeError('blop')
], 'gwak');
})();
Uncaught AggregateError: gwak
at REPL6:2:7
When AggregateError
is uncaught or inspected by util.inspect()
, its errors
property is ignored, so all individual errors are being swallowed. We can't get information about what exactly happened, where it happened, even how many errors there were.
What is the feature you are proposing to solve the problem?
Printing all .errors
with their respective stacktraces, either adding it to AggregateError
info or replacing it.
What alternatives have you considered?
Abbreviated output, something like AggregateError[ TypeError, TypeError, EvalError ]
. This still doesn't provide enough info: each aggregated error is an uncaught exception/rejection, and debug info should provide as much details as possible about them.