Skip to content

Commit

Permalink
fixup! worker: fix exit code for error thrown in handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkgoron committed Apr 1, 2021
1 parent 7cf8425 commit aa0c09d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/internal/main/worker_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/process-exit-code-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ function exitWithThrowInUncaughtHandler() {
}
cases.push({
func: exitWithThrowInUncaughtHandler,
result: 7,
result: 1,
error: /^Error: ok$/,
});

0 comments on commit aa0c09d

Please sign in to comment.