Node.js · Middle · Question 29 of 75
What changed in Express 5 for async route handlers?
- ✓Correct answer: A rejected promise is passed to
next(err)automatically, so errors reach the error handler - 2Express 5 requires every handler to return a promise
- 3Async handlers are no longer allowed
Explanation
In Express 4 a rejection in an async handler was unhandled unless you wrapped it with try/catch or a helper like express-async-handler.