Skip to content
RED SAG Skills
medium10 pts · first answer countsapi-designexpresserror-handling

Express error handler never runs

This middleware is meant to catch errors, but Express never calls it when a route calls next(err). Why?

app.use((err, req, res) => {
  res.status(500).json({ error: 'Something went wrong' })
})
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions