Skip to content

Commit e060060

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 3ac05b7 commit e060060

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,
@@ -700,7 +701,11 @@ const fatalExceptionStackEnhancers = {
700701
require('internal/tty').hasColors()) ||
701702
defaultColors);
702703
try {
703-
return inspect(error, { colors });
704+
return inspect(error, {
705+
colors,
706+
customInspect: false,
707+
depth: MathMax(inspect.defaultOptions.depth, 5)
708+
});
704709
} catch {
705710
return originalStack;
706711
}

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)