Skip to content

Instantly share code, notes, and snippets.

@pgte
Created March 20, 2012 13:10
Show Gist options
  • Save pgte/2135316 to your computer and use it in GitHub Desktop.
Save pgte/2135316 to your computer and use it in GitHub Desktop.
pedroteixeira:test pedroteixeira$ node test.js
uncaught exception [Error: abc1]
uncaught exception [Error: def]
uncaught exception [Error: abc2]
uncaught exception [Error: def]
process.on('uncaughtException', function(e) {
console.log('uncaught exception', e);
(function() {
throw new Error('def');
}());
});
setTimeout(function() {
throw new Error('abc1');
}, 1000);
setTimeout(function() {
throw new Error('abc2');
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment