Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not overwrite user-defined process's exit code to 1 #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

micalevisk
Copy link

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.

Code example:

// app.js
require('source-map-support').install();
process.exitCode = 123
throw new Error('test 123')

after running node app.js I'm expecting to see 123 as the exit code but I'm getting 1:

image

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant