Replaced the error handler.
This commit is contained in:
parent
d7409cac1c
commit
98194e6f47
1 changed files with 1 additions and 24 deletions
25
index.js
25
index.js
|
@ -329,31 +329,8 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (err && err.code == "ENOENT") {
|
} else {
|
||||||
elseCallback(); //Invoke default error handler
|
elseCallback(); //Invoke default error handler
|
||||||
} else {
|
|
||||||
if (!callServerError) {
|
|
||||||
res.writeHead(500, "Internal Server Error", abheaders);
|
|
||||||
res.write(
|
|
||||||
"<html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1><p>A server had unexpected exception. Below, the stack trace of the error is shown:</p><code>" +
|
|
||||||
err.stack.replace(/\r\n/g, "<br/>").replace(/\n/g, "<br/>").replace(/\r/g, "<br/>").replace(/ /g, " ") +
|
|
||||||
"</code><p>Please contact the developer/administrator of the website.</p><p style=\"font-style: italic; font-weight: normal;\">SVR.JS " +
|
|
||||||
configJSON.version +
|
|
||||||
" (" +
|
|
||||||
os.platform()[0].toUpperCase() +
|
|
||||||
os.platform().slice(1) +
|
|
||||||
"; Node.JS/" +
|
|
||||||
process.version +
|
|
||||||
") YellowSquare/" +
|
|
||||||
version +
|
|
||||||
" " +
|
|
||||||
(req.headers.host == undefined ? "" : " on " + req.headers.host) +
|
|
||||||
"</p></body></html>"
|
|
||||||
);
|
|
||||||
res.end();
|
|
||||||
} else {
|
|
||||||
callServerError(500, "YellowSquare/" + version, err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue