code: function (err, req, res) {
      console.error('uncaughtError', req.method + ' ' + req.url);
      this.sendErrorReport(err, req);
  
      if (req.accepts('html')) {
        this.renderErrorPage('error', err, req, res);
      } else {
        var error = new errors.HTTPError(500, 'Internal Server Error');
        this.renderError(error, req, res);
      }
    }
docs: Displays a friendly 500 page in production if requesting html otherwise returns an appropriate format.