You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Consider the following code (uncomment one of the lines (1) or (2)):
vardomain=require('domain');varhttp=require('http');varEventEmitter=require('events').EventEmitter;vard=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).