Quick Answer
In Express, if a route handler or middleware throws an error or calls next(err), Express automatically skips to the first error-handling middleware (one with 4 parameters: err, req, res, next). async handlers need try/catch and must pass errors to next() explicitly รขโฌโ Express doesn't automatically catch Promise rejections without a wrapper or asyncHandler utility.
Answer
Calling next(error) skips normal middleware and invokes error-handling middleware for consistent error responses.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.