Title: util: `SuppressedError` should print `error`/`suppressed` properties during inspection · Issue #66033 · nodejs/node · GitHub
Open Graph Title: util: `SuppressedError` should print `error`/`suppressed` properties during inspection · Issue #66033 · nodejs/node
X Title: util: `SuppressedError` should print `error`/`suppressed` properties during inspection · Issue #66033 · nodejs/node
Description: What is the problem this feature will solve? When a SuppressedError is thrown (e.g. from disposal errors during a using/await using block) and inspected via util.inspect() / console.log(), then the actual underlying errors (error and sup...
Open Graph Description: What is the problem this feature will solve? When a SuppressedError is thrown (e.g. from disposal errors during a using/await using block) and inspected via util.inspect() / console.log(), then the...
X Description: What is the problem this feature will solve? When a SuppressedError is thrown (e.g. from disposal errors during a using/await using block) and inspected via util.inspect() / console.log(), then the...
Opengraph URL: https://github.com/nodejs/node/issues/66033
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"util: `SuppressedError` should print `error`/`suppressed` properties during inspection","articleBody":"### What is the problem this feature will solve?\n\nWhen a `SuppressedError` is thrown (e.g. from disposal errors during a using/await using block) and inspected via `util.inspect()` / `console.log()`, then the actual underlying errors (`error` and `suppressed` properties) are not shown:\n\n```js\nclass Resource {\n [Symbol.dispose]() {\n throw new Error('error during dispose');\n }\n}\nfunction test() {\n using res = new Resource();\n throw new Error('error during execution');\n}\ntest();\n```\nCurrent output (Node v26.8.2):\n```\nSuppressedError: An error was suppressed during disposal.\n at test (REPL10:3:3)\n```\n\nBoth those errors are essential for debugging.\n\nThis has the exact same shape as two problems Node already solved for other \"container\" errors:\n\nAggregateError.errors was silently swallowed during inspection — fixed in #43646 (tracked in #43645).\nError.cause was silently swallowed during inspection — fixed in #41002 (tracked in #40859).\n\nSuppressedError.error / SuppressedError.suppressed fall into the same category and currently have no equivalent handling in formatError() (lib/internal/util/inspect.js).\n\n### What is the feature you are proposing to solve the problem?\n\nExtend `formatError()` so that, similar to how `cause` and `errors` are already special-cased, the non-enumerable error and suppressed properties of a SuppressedError are always included in the inspected output (recursively, since a SuppressedError can itself wrap another SuppressedError when multiple disposals fail).\n\nDesired output, roughly matching what the cause-chain rendering already does:\n```\nSuppressedError: An error was suppressed during disposal.\n at test (…)\n ... {\n [error]: Error: error during dispose\n at Resource.[Symbol.dispose] (…)\n ...,\n [suppressed]: Error: error during execution\n at test (…)\n ...\n}\n```\n\n### What alternatives have you considered?\n\n* Manually logging e.error and e.suppressed in application code — works, but requires every catch block to know it might be dealing with a SuppressedError.\n* A userland [util.inspect.custom] patch on SuppressedError.prototype — works.\n\nI believe a better out-of-the-box experience is required, rather than user-land patches. Workarounds shouldn't be necessary for a built-in error type tied to a TC39-standardized language feature","author":{"url":"https://github.com/zuozp8","@type":"Person","name":"zuozp8"},"datePublished":"2026-09-15T12:15:41Z","url":"https://github.com/nodejs/node/issues/66033"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0b86ec22-a7ac-822a-97b2-0506d10e01e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC56:2BA970:72B36:99095:6AED0452 |
| html-safe-nonce | 7e64b0d54036063043a5446b2348c1bee14ea1964198f2d282527515101b065a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzU2OjJCQTk3MDo3MkIzNjo5OTA5NTo2QUVEMDQ1MiIsInZpc2l0b3JfaWQiOiI4OTkyOTgyMzUyMTQ0NDM0MjU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9fda06a44e6f1b1edb9487e808e2d9d7052d2dc8de2eeac79bfb00b84e925c15 |
| hovercard-subject-tag | issue:5461755154 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66033/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3e9074c3dc6426e47df93ee779f08003553ef124a7b8764fde6782377a8dd0ce/nodejs/node/issues/66033 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3e9074c3dc6426e47df93ee779f08003553ef124a7b8764fde6782377a8dd0ce/nodejs/node/issues/66033 |
| og:image:alt | What is the problem this feature will solve? When a SuppressedError is thrown (e.g. from disposal errors during a using/await using block) and inspected via util.inspect() / console.log(), then the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zuozp8 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 21e10c535436b2122cfb44c76dfb4af296e371850fb60de16776f8a64e5c3ed8 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 302a6d707c3288a5f951258a2fa3e926b8c8f8cf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width