Open sdavids opened 4 years ago
I think this may be a documentation issue on the website; there is no requirement to delegate to the default handler if the headers have already been sent; users can do whatever logic they would like to do.
from the docs:
If you call next() with an error after you have started writing the response (for example, if you encounter an error while streaming the response to the client) the Express default error handler closes the connection and fails the request.
@sdavids Did you create the error handler after all the other routes. That could cause some issues if you didn't.
https://expressjs.com/en/guide/error-handling.html#the-default-error-handler
The
express-generator
does not follow the recommendation: