This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Description
Consider the following code (uncomment one of the lines (1) or (2)):
var domain = require('domain');
var http = require('http');
var EventEmitter = require('events').EventEmitter;
var d = domain.create();
d.on('error', function(err) {
console.log('unhandled error', err);
process.exit(1);
});
d.run(function() {
http.createServer(function(req, res) {
// throw new Error('uncaught throw'); // (1)
// new EventEmitter().emit('error', new Error('uncaught event')); // (2)
}).listen(3000);
});
When running in a debugger, the first statement (1) breaks on uncaught exception but the second (2) does not.
When the server is not running inside a domain, both (1) and (2) breaks on uncaught exception in V8 debugger.
See PR #5713 for the implementation of "break on uncaught exception" (v0.11 only).