update error handling

This commit is contained in:
Firepup Sixfifty 2025-01-30 11:12:20 -06:00
parent c2bb32dcf2
commit 1c84982232
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -514,12 +514,14 @@ app.use(function(req, res, next) {
res.status(404).render(dir + "errors/404.ejs");
});
app.use(function(error, req, res, next) {
console.log(error);
res.status(500).render(dir + "errors/500.ejs", { error });
});
app.listen(port, () => {
console.log(`Server started on port ${port}`);
});
app.on("error", error => {
console.log(error)
if (error.syscall !== "listen") {
throw error;
}