You can use the uncaughtException event on the process object to do what you want, but like others have said, domains and catching/handling errors at the correct level is recommended.
process.on('uncaughtException', function(err) {
console.log('Caught exception: ' + err);
});