util: only inspect error properties that are not visible otherwise · nodejs/node@848d81c · GitHub
Skip to content

Commit 848d81c

Browse files
Ruben Bridgewatertargos
authored andcommitted
util: only inspect error properties that are not visible otherwise
Inspecting errors results in duplicated information in case an error is created with enumerable `name`, `message` or `stack` properties. In that case, check if the output already contains that information and prevent listing that property. This reduces the noise as receiver. PR-URL: #32327 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
1 parent 2e015e5 commit 848d81c

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

lib/internal/util/inspect.js

Lines changed: 14 additions & 2 deletions

test/parallel/test-util-inspect.js

Lines changed: 22 additions & 0 deletions

0 commit comments

Comments
 (0)