-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Improve returned error.message
#180
Improve returned error.message
#180
Conversation
Since technically changing error messages is a breaking change and we have some other potential breaking changes coming up now, I guess we can do a major version after these changes, so we can make breaking changes now. |
We don't have to do this anymore. We just have to make sure we make this clear in the release notes (Note to self). |
Shouldn't these changes we done in a separate PR when fixing #179? |
The changes suggested in #179 can be done in a separate PR IMHO. Note that this PR makes adding those changes much easier. The backward compatibility fix I mentioned is on |
Sure |
This looks good 👌 Would you be interested in joining the project as a maintainer? No worries if not. Just thought I'd ask as you've done some good PRs 😃 |
Sure! 👍 My main motivation was that I have two projects closely related to
|
@ehmicky Awesome. Welcome to the project! |
Even if you have commit access, it's usually best to do a PR for changes, to get feedback. |
@sindresorhus sounds good. Is it ok to merge other developers PRs if the PR is a straightforward change, or do you prefer always giving it a thumbs up? |
I prefer PRs to get multiple reviews. One reviewer might miss something another reviewer might see. I will wait for you to review PRs too as I'm sure you will catch things I might miss too. |
I could also use your thoughts/comments on the existing issues :) |
Fix #177
This improves returned
error.message
by adding information about potential timeouts, signals and exit codes.This also fixes few issues with
result.code
:error.code = code < 0 ? errname(code) : code
.code
comes fromchildProcess.on('exit')
which is a positive integer most of the times. The fixed code avoids breaking backward compatibility by using the integer first if it's available.error.errno
was not used. There can be instances whereprocess.exit()
is not called buterror.errno
is available, which can be used as errorcode
instead.os.constants.errno
is used to retrieve the code string when possible.This also fixes
stderr
andstdout
being concatenated with a newline between them whenoptions.stdio
was not a string.