summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/internal/process/execution.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js
index 74d6575e0a..4ee890e9db 100644
--- a/lib/internal/process/execution.js
+++ b/lib/internal/process/execution.js
@@ -105,19 +105,14 @@ function createFatalException() {
if (er == null || er.domain == null) {
try {
const report = internalBinding('report');
- if (report != null) {
- if (require('internal/options').getOptionValue(
- '--experimental-report')) {
- const config = {};
- report.syncConfig(config, false);
- if (Array.isArray(config.events) &&
- config.events.includes('exception')) {
- if (er) {
- report.onUnCaughtException(er.stack);
- } else {
- report.onUnCaughtException(undefined);
- }
- }
+ if (report != null &&
+ require('internal/options')
+ .getOptionValue('--experimental-report')) {
+ const config = {};
+ report.syncConfig(config, false);
+ if (Array.isArray(config.events) &&
+ config.events.includes('exception')) {
+ report.onUnCaughtException(er ? er.stack : undefined);
}
}
} catch {} // NOOP, node_report unavailable.