InterviewBuddy
All interview questions

How does Express 5 handle rejected promises in route handlers?

Intermediate

Answer

Express 5 forwards rejection from a returned route-handler promise to error middleware. Express 4 generally requires explicit forwarding or a wrapper.

Explanation

Detached asynchronous work still needs its own error handling.

Example

An awaited database call rejects → Express 5 error middleware.