Skip to content
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

Added check for enoent error #10

Merged
merged 1 commit into from Apr 27, 2014
Merged

Added check for enoent error #10

merged 1 commit into from Apr 27, 2014

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Nov 22, 2013

This package is used by browser-launcher to launch a browser headlessly. When run on OSX, which doesn't have Xvfb installed by default, the call to spawn triggers an error event which is unhanded and displays this useless output:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

Added an listener for "error" that will pass back a useful error message when it can.

…ler on the child process, preventing 'uncaught error event' on systems without Xvfb installed
@graue
Copy link

graue commented Apr 27, 2014

Same here, on Ubuntu — I didn't have Xvfb installed, and was baffled at the spawn ENOENT error that Testling (which uses this package) threw up. A friendly error message like this would have saved me some time 👍

kesla added a commit that referenced this pull request Apr 27, 2014
@kesla kesla merged commit d3c0c85 into kesla:master Apr 27, 2014
@kesla
Copy link
Owner

kesla commented Apr 27, 2014

So, I haven't actually tested this PR (I don't use this module frequently anymore) - could someone take a look and ping me if it works as expected?

@graue
Copy link

graue commented Apr 27, 2014

Aw shoot. It doesn't. At least, Testling depending on browser-launcher depending on this doesn't work as expected. Now I feel bad for (implicitly) advocating for this to be merged, without trying it. Sorry about that.

What I did: uninstalled Xvfb from my system, and replaced Testling's node_modules/browser-launcher/node_modules/headless with latest master (both with and without this change). Without this change I get the ENOENT error. With this change it simply hangs, not reporting an error or anything. I'm currently trying to figure out why.

@graue
Copy link

graue commented Apr 27, 2014

Ah, never mind. node-headless is working perfectly. It's browser-launcher's fault for not checking for and re-throwing the error, and @spenceralger has already submitted a separate PR there: substack/browser-launcher#22. Thank you @kesla for merging this!

@kesla
Copy link
Owner

kesla commented Apr 27, 2014

Release as 0.1.7

@kesla
Copy link
Owner

kesla commented Apr 27, 2014

And @graue thanks for helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants