levexis/grunt-selenium-webdriver — pull request #14 by ryankinal (2014-10-28 16:14:56+00:00)
Title: Added error handling to function startPhantom. Closes #13

On error, `msg` seems to have two parts - a non-JSON part and a JSON part. The non-JSON starts with `[ERROR`, so I use that to detect the error state. I then substring and parse the JSON part, before logging the error to the console and exiting the process.

Please note that I am developing on Windows, so this has not been tested on OSX or any version of Linux.