I am trying to setup error handling for my express app and running into the following problem.
I defined an error middleware and add it as the last middleware:
instead of making
app.get('/datenschutz', function(req, res, next){ return next(new Error('Just testing')); // handle everything here });
you can install express-async-errors
and just make
app.get('/datenschutz', function(req, res){ throw new Error('Just testing'); });
it works as expected