Repository navigation
Conversation
By default, when node.js prints a stack it includes all of the
`node:internal` frames. This make the output more verbose but
it's often providing extraneous detail the user can't do
anything about. This adds a cli flag to hide those details.
It can be set in NODE_OPTIONS.
```console
$ node --hide-internal-stack-frames -e "require('node:fs').readFileSync('missing')"
...
Error: ENOENT: no such file or directory, open 'missing'
at Object.openSync (node:fs:779:18)
at Object.readFileSync (node:fs:625:35)
at [eval]:1:20
at <node:internal> (7 frames hidden) {
...
```
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Claude
The loop that splits error.stack into the report's javascriptStack.stack only emitted a line once it found the following newline, so the final frame was always dropped. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-By: Claude
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67715 +/- ##
==========================================
- Coverage 90.53% 90.53% -0.01%
==========================================
Files 801 801
Lines 284113 284251 +138
Branches 54874 54904 +30
==========================================
+ Hits 257230 257348 +118
Misses 17057 17057
- Partials 9826 9846 +20
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default, when node.js prints a stack it includes all of the
node:internalframes. This make the output more verbose butit's often providing extraneous detail the user can't do
anything about. This adds a cli flag to hide those details.
It can be set in NODE_OPTIONS.
Also fixes a latent bug in the
node_report.cc