Browse files

[fix] Fix a regression due to director errorHandling

  • Loading branch information...
1 parent beea320 commit b744ea404d2b193ee5f8c371b8770da0acd8800b @pksunkara pksunkara committed Mar 28, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/core.js
View
8 lib/core.js
@@ -67,11 +67,11 @@ core.createServer = function (options) {
core.errorHandler = function error(err, req, res) {
if (err) {
- res.writeHead(err.status || 500, err.headers || { "Content-Type": "text/plain" });
- res.end(err.stack + "\n");
+ (this.res || res).writeHead(err.status || 500, err.headers || { "Content-Type": "text/plain" });
+ (this.res || res).end(err.stack + "\n");
return;
}
- res.writeHead(404, {"Content-Type": "text/plain"});
- res.end("Not Found\n");
+ (this.res || res).writeHead(404, {"Content-Type": "text/plain"});
+ (this.res || res).end("Not Found\n");
};

0 comments on commit b744ea4

Please sign in to comment.