You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to suggest that instead of calling process.exit(), we throw an Error.
As described in node's documentation for process.exit(), using this method is problematic because it disrupts all asynchronous work in progress. The documentation recommends using an error instead:
If it is necessary to terminate the Node.js process due to an error condition, throwing an uncaught error and allowing the process to terminate accordingly is safer than calling process.exit().
One concern with making this change would be preserving the functionality of opts.exitCode. I believe we can set process.exitCode right before throwing the error, and it should preserve the intended behavior.
If the maintainers are happy with this idea, I can contribute the change in a PR.
The text was updated successfully, but these errors were encountered:
I'd like to suggest that instead of calling
process.exit()
, we throw anError
.As described in node's documentation for
process.exit()
, using this method is problematic because it disrupts all asynchronous work in progress. The documentation recommends using an error instead:One concern with making this change would be preserving the functionality of
opts.exitCode
. I believe we can setprocess.exitCode
right before throwing the error, and it should preserve the intended behavior.If the maintainers are happy with this idea, I can contribute the change in a PR.
The text was updated successfully, but these errors were encountered: