Skip to content

Instantly share code, notes, and snippets.

@dscape
Created March 20, 2012 14:01
Show Gist options
  • Save dscape/2135922 to your computer and use it in GitHub Desktop.
Save dscape/2135922 to your computer and use it in GitHub Desktop.
function f() {
throw new Error('def');
}
process.on('uncaughtException', function(e) {
console.log('uncaught exception', e);
f();
});
f();
function g() {
process.nextTick(function() { throw new Error('def'); });
}
process.on('uncaughtException', function(e) {
console.log('uncaught exception', e);
g();
});
g();
$ node index.js
uncaught exception [Error: def]
uncaught exception [Error: def]
uncaught exception [Error: def]
uncaught exception [Error: def]
uncaught exception [Error: def]
... continues
$ node index.js
uncaught exception [Error: def]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment