Skip to content

Instantly share code, notes, and snippets.

@misterdjules
Created November 17, 2014 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterdjules/c073a712b9ebc8b47fc9 to your computer and use it in GitHub Desktop.
Save misterdjules/c073a712b9ebc8b47fc9 to your computer and use it in GitHub Desktop.
var domain = require('domain');
var d = domain.create();
d.on('error', function() {
console.log('error handler')
});
d.run(function doStuff() {
setTimeout(function() {
throw new Error('threw from timer');
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment