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
error.code is not always available #536
Comments
This may be nodejs problem. The callback argument is:
And it is an instance of Error. The doc language may suggest the error code doesn't have to be set:
But neither The parent process seems to be terminating with SIGTERM, and it's shelljs that is killing it. Same happens on NodeJS v6 (6.9.1) |
@veselov you're saying that since Would it be sufficient to use
Yup, shelljs currently kills the process. Please see #483. If you'd like to help, I would love to review a pull request. Could you take a look at #524? It's going to be an alternative to |
Opening this up for community contributions. Before this can be closed:
If we fix just the first bullet point, we can cut a patch release in v0.7. No need to get rid of |
I'm saying that it seems to be NodeJS issue because neither
I would diagnose this first. If there is a reason to believe that this only happens when shelljs kills the child (I haven't seen it happen in other cases), then I'd use 127.
Are you saying something happens in shelljs that makes it die, and kill the children? And that's what I'm seeing? I'm not seeing any output from shelljs that indicates that it's having any kind of a problem. |
Oh, I misunderstood. I thought you meant that shelljs was killing the current node process, not the child process spawned by If I misunderstood you, then that issue is unrelated to this. |
If an error exists, but has no error code, it defaults to 1 (a common code for most Unix commands). Tests have been omitted since this is an edge case that is difficult to reproduce. Fixes #536
If an error exists, but has no error code, it defaults to 1 (a common code for most Unix commands). Tests have been omitted since this is an edge case that is difficult to reproduce. Fixes #536
Node version (or tell us if you're using electron or some other framework):
4.x
ShellJS version (the most recent version/Github branch you see the bug on):
0.7.4
Operating system:
Linux FC23
Description of the bug:
Experienced this when running some scripts under mocha:
Example ShellJS command to reproduce the error:
Unknown
Error:
/tmp/shelljs_67e6b2ac42f07ecaa8c5:4
The crafted shell file (/tmp/shelljs_67e6b2ac42f07ecaa8c5) is not available.
The text was updated successfully, but these errors were encountered: