Chapter 11: Error Handling completed sample

This commit is contained in:
Beth Griggs
2020-11-15 00:56:57 +00:00
parent 51fee88f90
commit 791aac76d7
10 changed files with 2 additions and 190 deletions
+2 -2
View File
@@ -40,9 +40,9 @@ app.use(function (err, req, res, next) {
res.render("error");
});
module.exports = app;
process.on("unhandledRejection", (reason, promise) => {
console.log("Unhandled Rejection at:", promise, "reason:", reason);
process.exit(1);
});
module.exports = app;