Which of these is the correct way to handle errors in an async Express 4 route handler?
- A Rely on Express to catch the rejection automatically
- B Wrap the handler so rejections are passed to next(err)
- C Use process.on('uncaughtException')
- D Return the error as a string
Answer
Wrap the handler so rejections are passed to next(err)
Express 4 does not catch rejected promises from async handlers, so the request hangs. Express 5 handles this natively.





