-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Better support for Error.cause
in util.inspect
/console.log
#40859
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.
util
Issues and PRs related to the built-in util module.
Comments
targos
added
feature request
Issues that request new features to be added to Node.js.
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
labels
Nov 18, 2021
I implemented something locally. It always prints the non-enumerable |
Looks good to me! |
There is already a bit of discussion on this here: #38725 (comment) |
nodejs-github-bot
pushed a commit
that referenced
this issue
Dec 2, 2021
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41002 Fixes: #40859 Fixes: #38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams
pushed a commit
that referenced
this issue
Dec 14, 2021
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41002 Fixes: #40859 Fixes: #38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams
pushed a commit
that referenced
this issue
Jan 31, 2022
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41002 Fixes: #40859 Fixes: #38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams
pushed a commit
that referenced
this issue
Jan 31, 2022
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41002 Fixes: #40859 Fixes: #38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Linkgoron
pushed a commit
to Linkgoron/node
that referenced
this issue
Jan 31, 2022
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: nodejs#41002 Fixes: nodejs#40859 Fixes: nodejs#38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams
pushed a commit
that referenced
this issue
Feb 1, 2022
While inspecting errors, always visualize the cause. That property is non-enumerable by default while being useful in general for debugging. Duplicated stack frames are hidden. Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #41002 Fixes: #40859 Fixes: #38725 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.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.
util
Issues and PRs related to the built-in util module.
Is your feature request related to a problem? Please describe.
Given this code:
The output only contains the error message and stack for error three.
It is already possible to see the value of
cause
, whenshowHidden
is enabled, but in my opinion this is not a good general solution because it makes the output too verbose and requires to set a global config forconsole.log
.Describe the solution you'd like
I'm open to suggestions. One idea I have is to output something recursively indented like this:
/cc @nodejs/util
The text was updated successfully, but these errors were encountered: