It doesn’t working either
EDIT: OK, I’ve got it working using both your handler and the next() function.
But what is weird is that it shouldn’t require the next() function to be used, but I could send it using the response
variable, retrieved during the Express request.
See: Overriden routes error management
Is there any way not to use the next() function but this response.status(400).send('error message');
?
Because it seems working for @JeremyV
Using the errorHandler middleware prevents me from sending success custom message.