kesla/node-headless — pull request #10 by spenceralger (2013-11-22 19:48:44+00:00)
Title: Added check for enoent error

This package is used by [testling](https://github.com/substack/testling) 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.