code: function defaultErrorHandler(err, req, res) {
    if (err.name === 'UnauthorizedError') { // authentication is expected to be a common use-case
      res.status(401).end();
    } else {
      if (!err.status || err.status >= 500) {
        console.error(err.stack || err.toString());
      }
      res.status(err.status || 500).json({message: err.message})
    }
  }
docs: The default error handler, in case none is provided by the application.
  @private