Skip to content
RED SAG Skills
hard20 pts · first answer countsapi-designnodejserror-handling

A forgotten await crashes the server

After upgrading Node.js, the server sometimes exits when an audit-log call fails. The call is not awaited and has no .catch. Why?

function handler(req, res) {
  auditLog.write(req.user, 'viewed') // returns a promise
  res.json({ ok: true })
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions