-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspect: print individual AggregateError.errors
#43645
Labels
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
feature request
Issues that request new features to be added to Node.js.
inspector
Issues and PRs related to the V8 inspector protocol
Comments
LiviaMedeiros
added
feature request
Issues that request new features to be added to Node.js.
inspector
Issues and PRs related to the V8 inspector protocol
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
labels
Jul 1, 2022
Would it be possible to make this nested/recurse? (()=>{throw new AggregateError([new AggregateError([new TypeError('blep'), new RangeError('blop')], 'inner')],'gwak')})()
Uncaught AggregateError: gwak
at REPL2:1:13 {
[errors]: [
AggregateError: inner
at REPL2:1:33
at REPL2:1:120
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at REPLServer.Interface._onLine (node:readline:491:10) {
[errors]: [Array]
}
]
} Notice |
This is recursive, but the depth is limited by default. > [[[123]]]
[ [ [ 123 ] ] ]
> [[[[123]]]]
[ [ [ [Array] ] ] ] Inspecting explicitly: > try {
(()=>{throw new AggregateError([new AggregateError([new TypeError('blep'), new RangeError('blop')], 'inner')],'gwak')})()
} catch(e) { console.log(util.inspect(e)) }
AggregateError: gwak
at REPL34:1:19
at REPL34:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12) {
[errors]: [
AggregateError: inner
at REPL34:1:39
at REPL34:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12) {
[errors]: [Array]
}
]
} Inspecting with > try {
(()=>{throw new AggregateError([new AggregateError([new TypeError('blep'), new RangeError('blop')], 'inner')],'gwak')})()
} catch(e) { console.log(util.inspect(e, { depth: 9 })) }
AggregateError: gwak
at REPL37:1:19
at REPL37:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12) {
[errors]: [
AggregateError: inner
at REPL37:1:39
at REPL37:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12) {
[errors]: [
TypeError: blep
at REPL37:1:59
at REPL37:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12),
RangeError: blop
at REPL37:1:82
at REPL37:1:126
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:572:29)
at bound (node:domain:433:15)
at REPLServer.runBound [as eval] (node:domain:444:12)
at REPLServer.onLine (node:repl:902:10)
at REPLServer.emit (node:events:525:35)
at REPLServer.emit (node:domain:489:12)
at [_onLine] [as _onLine] (node:internal/readline/interface:425:12)
]
}
]
} |
Right, my point was more if it could work by default for |
guangwong
pushed a commit
to noslate-project/node
that referenced
this issue
Oct 10, 2022
PR-URL: nodejs/node#43646 Fixes: nodejs/node#43645 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
feature request
Issues that request new features to be added to Node.js.
inspector
Issues and PRs related to the V8 inspector protocol
What is the problem this feature will solve?
When
AggregateError
is uncaught or inspected byutil.inspect()
, itserrors
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 toAggregateError
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.The text was updated successfully, but these errors were encountered: