errors: fully inspect errors on exit

This makes sure errors are fully inspected during exit. That is
important to provide as many debugging information to the user as
possible.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/33523
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater authored and Shelley Vohr committed 2020-07-08 14:11:46 -07:00
1 parent 0f0720a665
commit 76b06e53c6
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -16,6 +16,7 @@ const {
JSONStringify,
Map,
MathAbs,
MathMax,
NumberIsInteger,
ObjectDefineProperty,
ObjectKeys,
@@ -695,7 +696,11 @@ const fatalExceptionStackEnhancers = {
require('internal/tty').hasColors()) ||
defaultColors);
try {
return inspect(error, { colors });
return inspect(error, {
colors,
customInspect: false,
depth: MathMax(inspect.defaultOptions.depth, 5)
});
} catch {
return originalStack;
}
+1 -1
View File
@@ -29,6 +29,6 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
at *
at *
at *,
expected: [Object],
expected: { bar: true },
operator: 'throws'
}