Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created January 22, 2010 06:49
Show Gist options
  • Save isaacs/283562 to your computer and use it in GitHub Desktop.
Save isaacs/283562 to your computer and use it in GitHub Desktop.
var sys = require("sys");
function someFunc () {
throw "thrown from someFunc"
};
function h1 (m) {
sys.debug("caught in h1: "+m);
}
function h2 (m) {
sys.debug("caught in h2: "+m);
}
process.exceptionCatcher = h1;
setTimeout(someFunc);
process.exceptionCatcher = h2;
setTimeout(someFunc);
// expect: "caught in h1: ...\ncaught in h2: ..."
// actual: "caught in h2: ...\ncaught in h2: ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment