lib/services/publish.js
function validatePublishRules(uri, { val, errors }) {
  let err, errMsg;

  if (!val) {
    errMsg = `Error publishing page: ${replaceVersion(uri)}`;
    log('error', errMsg, { publishRuleErrors: errors });
    err = new Error(errMsg);
    err.status = 400;
    return bluebird.reject(err);
  }

  return val;
}
function validatePublishRules(uri, { val, errors }) {
  let err, errMsg;

  if (!val) {
    errMsg = `Error publishing page: ${replaceVersion(uri)}`;
    log('error', errMsg, { publishRuleErrors: errors });
    err = new Error(errMsg);
    err.status = 400;
    return bluebird.reject(err);
  }

  return val;
}
function validatePublishRules ( uri , { val , errors } ) { let err , errMsg ; if ( ! val ) { errMsg = ` ${ replaceVersion ( uri ) } ` ; log ( 'error' , errMsg , { publishRuleErrors : errors } ) ; err = new Error ( errMsg ) ; err . status = 400 ; return bluebird . reject ( err ) ; } return val ; }
Given the response from the processing of the
publish rules, determine if we need to log errors
or if we're good to proceed.

@param {String} uri
@param {String} val
@param {Object} errors
@returns {String|Promise<Error>}
Given the response from the processing of the publish rules determine if we need to log errors or if we re good to proceed .