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 %>
<% } %>