express error handler code code example
Example 1: how to handle all error of all router in express
const handleErrorAsync = func => (req, res, next) => {
func(req, res, next).catch((error) => next(error));
};
Example 2: error * route
app.get('*', (request, response) => response.status(404).send('This route does not exist'));