From 1c84982232df3c530dfa43345db2980f16b3b593 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Thu, 30 Jan 2025 11:12:20 -0600 Subject: [PATCH] update error handling --- index.js | 2 ++ public/errors/500.ejs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ece7b22..f858af0 100644 --- a/index.js +++ b/index.js @@ -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; } diff --git a/public/errors/500.ejs b/public/errors/500.ejs index 3f051a5..8b892f2 100644 --- a/public/errors/500.ejs +++ b/public/errors/500.ejs @@ -14,8 +14,6 @@

500 Internal Server Error

An error has occurred on the server.

<% if (error) { %> -

Error message:

-
<%= error.message %>

Stack trace:

<%= error.stack %>
<% } %>