From aa0c09dd822f70997cff909929addd675aacbde9 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Thu, 1 Apr 2021 11:15:02 +0300 Subject: [PATCH] fixup! worker: fix exit code for error thrown in handler --- lib/internal/main/worker_thread.js | 2 +- test/fixtures/process-exit-code-cases.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 3b8356e2859ef0..cd092381eaef73 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -215,7 +215,7 @@ function workerOnGlobalUncaughtException(error, fromPromise) { if (!process._exiting) { try { process._exiting = true; - process.exitCode = handlerThrew ? 7 : 1; + process.exitCode = 1; if (!handlerThrew) { process.emit('exit', process.exitCode); } diff --git a/test/fixtures/process-exit-code-cases.js b/test/fixtures/process-exit-code-cases.js index 3f1a4145b57ca9..ca1ae9d37921ec 100644 --- a/test/fixtures/process-exit-code-cases.js +++ b/test/fixtures/process-exit-code-cases.js @@ -120,6 +120,6 @@ function exitWithThrowInUncaughtHandler() { } cases.push({ func: exitWithThrowInUncaughtHandler, - result: 7, + result: 1, error: /^Error: ok$/, });