-
Notifications
You must be signed in to change notification settings - Fork 78
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
Detecting a failure to execute the process #18
Comments
Yes, this seems like something we should handle uniformly. I'm not sure exactly how, e.g. on Unix we would need to somehow communicate back to the parent process that the exec() call failed. I may take a look at how OpenJDK does this and adopt that technique. |
Setting up a pipe with FD_CLOEXEC and then wait for it to be closed in the parent, or optionally write the error back is probably the right approach for this. |
Now released in the 0.2.4 gem. |
Ballin': hashicorp/vagrant@0d2cf4b |
ChildProcess currently doesn't provide a uniform way to detect that there was a failure to execute the given process. Java differs from Linux which differs from Windows.
It would be nice if there was a uniform error I could catch that would signal that ChildProcess wasn't able to start the childprocess... though I'm not sure how to do that easily portably.
In the mean time, I'm building it in to a helper to catch the various exit cases...
For example, executing
foo bar baz
...On Linux
The following comes through via the
stderr
of the child process:On Java
The following exception is raised directly in the parent process:
On Windows
(I haven't tested on Windows, sorry, but I imagine it will be different)
The text was updated successfully, but these errors were encountered: