errplane/errplane-nodejs — pull request #2 by mnutt (2013-03-15 03:28:46+00:00)
Title: add cluster support to uncaughtException handling

This adds support for apps running with the cluster module. It's a little unwieldy because it has to be called in both the master and workers, which may or may not happen by default depending on how you set up cluster.

It's a bit more opinionated in that it re-throws the error if no other uncaughtException listeners are attached. This will cause the worker to throw a nice stack trace to stdout before dying. Feel free to modify it to be more in line with handleUncaughtExceptions() if you'd like.