Skip to content

Commit

Permalink
fixup!: fix checks with V8_ENABLE_CHECKS
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Apr 19, 2021
1 parent 386f07b commit 3504831
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/internal/process/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@ function createOnGlobalUncaughtException() {
try {
const report = internalBinding('report');
if (report != null && report.shouldReportOnUncaughtException()) {
report.writeReport(er ? er.message : 'Exception',
'Exception',
null,
er ? er : {});
report.writeReport(
typeof er?.message === 'string' ?
er.message :
'Exception',
'Exception',
null,
er ? er : {});
}
} catch {} // Ignore the exception. Diagnostic reporting is unavailable.
}
Expand Down
1 change: 1 addition & 0 deletions test/report/test-report-uncaught-exception-primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ process.on('uncaughtException', common.mustCall((err) => {
assert.strictEqual(reports.length, 1);
console.log(reports[0]);
helper.validate(reports[0], [
['header.event', 'Exception'],
['javascriptStack.message', `${exception}`],
]);
}));
Expand Down
1 change: 1 addition & 0 deletions test/report/test-report-uncaught-exception-symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ process.on('uncaughtException', common.mustCall((err) => {
assert.strictEqual(reports.length, 1);
console.log(reports[0]);
helper.validate(reports[0], [
['header.event', 'Exception'],
['javascriptStack.message', 'Symbol(foobar)'],
]);
}));
Expand Down

0 comments on commit 3504831

Please sign in to comment.