code: function (err) {
      var status = typeof err === 'number' ? err : err.status;
  
      if (!(err instanceof errors.HTTPError) && status) {
        return errors.create(status, err.message);
      }
      return err;
    }
docs: Checks to see if the error has a status property and if so converts it into an instance of HTTPError. Just returns this original error if no status is found.