-
Notifications
You must be signed in to change notification settings - Fork 3
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
Option to not throw on non-zero exit code #60
Comments
The default behavior is fine as it matches Node's promisify behaviour: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
Accessing the |
@vjpr Yeah I need to improve the docs, thanks for pointing this out. If it throws, you can read |
Would be good. |
would the following code work to capture exit code in all success and failure cases?
|
@ranasaria Well if the process exits because of a signal, |
I read your docs, noticed that you were returning the exit code, and assumed that I would not need to catch an exception if the child process exited non-zero. I would recommend changing either the behavior or the docs. Thanks for the lib 👍 |
It seems to throw on non-zero exit code. I would like to avoid wrapping in try/catch, and read the code.
The documentation has an example showing usage of the
{code}
in the result. This is confusing because you cannot read the code it if throws.The text was updated successfully, but these errors were encountered: