fac-12 / dater

Week 8 project using Express and Handlebars
0 stars 0 forks source link

Error handling / 404 & 500 #19

Open Dragomirc opened 6 years ago

Dragomirc commented 6 years ago

If you go to an unexisting endpoint there is no error displayed for the user. In our project we rendered the error.hbs but sendind a res.status(404 or 500), when we were handling the error in the first err callback(not sure how you do it with promises. but I assume you do it in your catch.

BartBucknill commented 6 years ago

Also the error handling middleware is commented out in the controllers/index.js. However, in the addIdea.js handler for example, you call next(err), which suggests that you do in fact want to use the error handling middleware.