From 528e7dc728f6c8625beefd5e4512891ec2a07f26 Mon Sep 17 00:00:00 2001 From: "Micael Levi L. Cavalcante" Date: Tue, 2 Jul 2024 14:54:56 -0400 Subject: [PATCH] fix: do not overwrite user-defined process's exit code to 1 Instead of exiting with 1 we must keep the user-land value defined for `process.exitCode` if it's non-zero otherwise we end up changing the error code defined by the consumer of this lib. --- source-map-support.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-map-support.js b/source-map-support.js index 2942b5e..d28bea7 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -497,7 +497,7 @@ function printErrorAndExit (error) { } console.error(error.stack); - globalProcessExit(1); + globalProcessExit(process.exitCode || 1); } function shimEmitUncaughtException () {