Express.js Book - Express Web Application Development » Topic: Domain handler on error handler http://expressjs-book.com/forums/topic/domain-handler-on-error-handler/feed/ Sat, 16 May 2015 19:58:32 +0000 http://bbpress.org/?v=2.5.4-5380 en-US http://expressjs-book.com/forums/topic/domain-handler-on-error-handler/#post-81 <![CDATA[Domain handler on error handler]]> http://expressjs-book.com/forums/topic/domain-handler-on-error-handler/#post-81 Sat, 24 Aug 2013 21:01:08 +0000 gdbtek On page 202, here is the sample code to handle error on domain. However, I don’t quite understand the whole example. I looked at sample at http://nodejs.org/api/domain.html but this do not use express. Can you provide full sample for following sample?

// Domain error handler
d.on('error', function(err) {
// Stop accepting new connections
server.close();
// Perform last-minute cleanup
res.send(500);
// Let the master know the worker has disconnected
cluster.worker.disconnect();
// Terminate the process in 5 seconds
setTimeout(function() {
// Exit with a failure code
process.process.exit(1);
}, 5000);
});
]]>
http://expressjs-book.com/forums/topic/domain-handler-on-error-handler/#post-87 <![CDATA[Reply To: Domain handler on error handler]]> http://expressjs-book.com/forums/topic/domain-handler-on-error-handler/#post-87 Mon, 26 Aug 2013 08:49:02 +0000 Yaapa The example on Page no. 201 is a complete example using an Express app.

]]>