Skip to content

inspect: print individual AggregateError.errors #43645

Closed
@LiviaMedeiros

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.

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originated in Node.js core.feature requestIssues that request new features to be added to Node.js.inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions