Conversation
util.inspect() (and console.log()) silently dropped a SuppressedError's `error` and `suppressed` properties, the two pieces of information needed to actually debug a disposal failure. Both properties are non-enumerable, so they never showed up without this. formatError() already special-cases two other non-enumerable "container" properties for the same reason: Error's `cause` (nodejs#41002) and AggregateError's `errors` (nodejs#43646). Handle SuppressedError's `error` and `suppressed` the same way; nested SuppressedErrors (from multiple failed disposals) are shown recursively since inspect() already recurses into any Error-valued property. Fixes: nodejs#66033 Signed-off-by: agape1225 <49804691+agape1225@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66159 +/- ##
==========================================
+ Coverage 90.27% 90.28% +0.01%
==========================================
Files 790 790
Lines 271981 271991 +10
Branches 51913 51948 +35
==========================================
+ Hits 245531 245574 +43
+ Misses 16945 16905 -40
- Partials 9505 9512 +7
🚀 New features to boost your workflow:
|
ljharb
reviewed
Sep 20, 2026
Comment on lines
+775
to
+776
| const custom = new Error('No own error/suppressed property'); | ||
| Object.setPrototypeOf(custom, suppressedError); |
Member
There was a problem hiding this comment.
why not:
Suggested change
| const custom = new Error('No own error/suppressed property'); | |
| Object.setPrototypeOf(custom, suppressedError); | |
| const custom = new SuppressedError('No own error/suppressed property'); |
?
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion! I'd like to keep the original version, though — SuppressedError's signature is (error, suppressed, message), so with just one argument that string becomes error, not the message, and both error/suppressed end up as own properties (same as cause above). That means it wouldn't exercise the 'no own property' case this block is meant to test. Happy to tweak the comment or naming if that'd help.
meixg
approved these changes
Sep 21, 2026
jasnell
approved these changes
Sep 21, 2026
Collaborator
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.
util.inspect() (and console.log()) silently dropped a SuppressedError's
errorandsuppressedproperties, the two pieces of information needed to actually debug a disposal failure. Both properties are non-enumerable, so they never showed up without this.formatError() already special-cases two other non-enumerable "container" properties for the same reason: Error's
cause(#41002) and AggregateError'serrors(#43646). Handle SuppressedError'serrorandsuppressedthe same way; nested SuppressedErrors (from multiple failed disposals) are shown recursively since inspect() already recurses into any Error-valued property.Fixes: #66033