Skip to content

Commit

Permalink
Don't try to send a reponse from the domain error handler. It's alway…
Browse files Browse the repository at this point in the history
…s too late (and `res` is undefined).
  • Loading branch information
danmactough committed Mar 10, 2014
1 parent 010c428 commit 17306e3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions index.js
Expand Up @@ -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);
}
});

Expand Down

0 comments on commit 17306e3

Please sign in to comment.