complete-node-bootcamp
complete-node-bootcamp copied to clipboard
app.use(globalErrorHandler)
is not working
@trimi-cyber in errorController.js file do the following changes...
module.exports = (err, req, res) change this to module.exports = (err, req, res, next)
sendErrorDev(err, req, res) to sendErrorDev(err, req, res, next)
sendErrorProd(error, req, res) to sendErrorProd(error, req, res, next)
and dont forgot to call next() method in both sendErrorDev and sendErrorProd
hope this will help
If you're following "Handling Duplicate Database Fields", you can fix by doing:
