Skip to content
RED SAGSkills
hard20 pts · first answer countsnodejsexpresserror-handling

Async error skips Express handler

This app runs Express 4 on Node 22, and loadReport() rejects. What happens?

app.get('/report', async (req, res) => {
  const data = await loadReport()
  res.json(data)
})

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

Discussion 0

Join free to post in the discussion.

Related questions