forked from svrjs/svrjs
Remove unneeded code
This commit is contained in:
parent
bced5927fe
commit
3eb7f3d4d9
1 changed files with 2 additions and 19 deletions
|
@ -730,27 +730,10 @@ function requestHandler(req, res) {
|
||||||
try {
|
try {
|
||||||
currentMiddleware(req, res, logFacilities, config, next);
|
currentMiddleware(req, res, logFacilities, config, next);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (res.error) res.error(500, err);
|
res.error(500, err);
|
||||||
else {
|
|
||||||
logFacilities.errmessage(
|
|
||||||
"There was an error while processing the request!",
|
|
||||||
);
|
|
||||||
logFacilities.errmessage("Stack:");
|
|
||||||
logFacilities.errmessage(err.stack);
|
|
||||||
res.writeHead(500, "Internal Server Error", {
|
|
||||||
Server: generateServerString(config.exposeServerVersion),
|
|
||||||
});
|
|
||||||
res.end("Error while executing the request handler");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (res.error) res.error(404);
|
res.error(404);
|
||||||
else {
|
|
||||||
res.writeHead(404, "Not Found", {
|
|
||||||
Server: generateServerString(config.exposeServerVersion),
|
|
||||||
});
|
|
||||||
res.end("Request handler missing");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Reference in a new issue