From 17306e3aebe4c72f1b62c1852abf8bb03000164f Mon Sep 17 00:00:00 2001 From: Dan MacTough Date: Mon, 10 Mar 2014 09:56:54 -0400 Subject: [PATCH] Don't try to send a reponse from the domain error handler. It's always too late (and `res` is undefined). --- index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/index.js b/index.js index 7b1e125..a03c921 100644 --- a/index.js +++ b/index.js @@ -29,14 +29,9 @@ exports.attach = function (options) { // 'disconnect' in the cluster master, and then it will fork // a new worker. cluster.worker.disconnect(); - - // try to send an error to the request that triggered the problem - res.writeHead(500, {'content-type': 'text/plain'}); - res.write('Internal server error. Please try again later.'); - res.end(); } catch (err2) { // oh well, not much we can do at this point. - console.error('Error sending 500!', err2.stack || err2); + console.error('Error closing server', err2.stack || err2); } });