baudehlo/node-phantom-simple — pull request #15 by WalrusCow (2013-12-15 03:34:35+00:00)
Title: Safely kill child process on exit

Kept running into issues with the child process continuing to run after an uncaught exception. Added a safety mechanism to deal with that. I made sure to still print the stack trace, and wrap it in a `try` in case it was already closed.

I decided to kill the process on `SIGINT` and `SIGTERM`. Although I'm not sure that it is necessary, I figured that it can't hurt.