Skip to content

Commit 76b06e5

Browse files
BridgeARcodebytere
authored andcommitted
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 <[email protected]> PR-URL: #33523 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0f0720a commit 76b06e5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/internal/errors.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
JSONStringify,
1717
Map,
1818
MathAbs,
19+
MathMax,
1920
NumberIsInteger,
2021
ObjectDefineProperty,
2122
ObjectKeys,
@@ -695,7 +696,11 @@ const fatalExceptionStackEnhancers = {
695696
require('internal/tty').hasColors()) ||
696697
defaultColors);
697698
try {
698-
return inspect(error, { colors });
699+
return inspect(error, {
700+
colors,
701+
customInspect: false,
702+
depth: MathMax(inspect.defaultOptions.depth, 5)
703+
});
699704
} catch {
700705
return originalStack;
701706
}

test/message/assert_throws_stack.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
2929
at *
3030
at *
3131
at *,
32-
expected: [Object],
32+
expected: { bar: true },
3333
operator: 'throws'
3434
}

0 commit comments

Comments
 (0)