module.exports = handler => async (req, res, next) => {
  try {
    await handler(req, res, next);
  } catch (e) {
    if (!res.headersSent) {
      const status = e.status || e.statusCode || 500;
      if (e.message) {
        res.status(status).send(e.message);
      } else {
        res.sendStatus(status);
      }
    }
  }
};

module.exports = handler => async (req, res, next) => {
  try {
    await handler(req, res, next);
  } catch (e) {
    if (!res.headersSent) {
      const status = e.code || e.status || e.statusCode || 500;
      if (e.message) {
        res.status(status).send(e.message);
      } else {
        res.sendStatus(status);
      }
    }
  }
};

Add "e.code" as possible status
Add "e.code" as possible status
