In Express 4, synchronous errors thrown inside a route handler are caught automatically by Express. However, errors inside async/await functions or Promises must be passed to next(err) (or handled via Express 5 / a wrapper function) so your app doesn't crash or hang.
ADVERTISEMENT