Thrown on commit when validation errors are found
969955
public static InvalidKBException validationErrors(List<String> errors){
        StringBuilder message = new StringBuilder();
        message.append(ErrorMessage.VALIDATION.getMessage(errors.size()));
        for (String s : errors) {
            message.append(s);
        }
        return create(message.toString());
    }
350511
def handle_database_error(cls, session, exception):
        """"""

        session.rollback()

        if isinstance(exception, IntegrityError):
            cls.handle_integrity_error(exception)
        elif isinstance(exception, FlushError):
            cls.handle_flush_error(exception)
        else:
            raise exception
576059
def validate(self):
        """"""
        validator = Draft4Validator(self.SCHEMA)
        if not validator.is_valid(self.config):
            for err in validator.iter_errors(self.config):
                LOGGER.error(str(err.message))
            validator.validate(self.config)
1244773
public void addError(ValidationError error) {
        if (CollectionUtil.isEmpty(errors)) {
            errors = CollectionUtil.createArrayList(Const.INITIAL_CAPACITY);
        }
        errors.add(error);
    }
1147093
def save!(*args)
      raise Exceptions::ValidationFailedException.new(errors.inspect) if !save(*args)
      true
    end
1353075
def _validation_error(prop, prop_type, prop_value, expected):
    

    if prop_type is None:
        attrib = 'value'
        assigned = prop_value
    else:
        attrib = 'type'
        assigned = prop_type

    raise ValidationError(
        'Invalid property {attrib} for {prop}:\n\t{attrib}: {assigned}\n\texpected: {expected}',
        attrib=attrib, prop=prop, assigned=assigned, expected=expected,
        invalid={prop: prop_value} if attrib == 'value' else {}
    )
462838
public static void validateRemoteRefUpdates(String errorPrefix, Collection<RemoteRefUpdate> refUpdates) {
                for (RemoteRefUpdate refUpdate : refUpdates) {
                        RemoteRefUpdate.Status status = refUpdate.getStatus();

                        if (status == RemoteRefUpdate.Status.REJECTED_NODELETE ||
                            status == RemoteRefUpdate.Status.NON_EXISTING ||
                            status == RemoteRefUpdate.Status.NOT_ATTEMPTED ||
                            status == RemoteRefUpdate.Status.REJECTED_NONFASTFORWARD ||
                            status == RemoteRefUpdate.Status.REJECTED_OTHER_REASON ||
                            status == RemoteRefUpdate.Status.REJECTED_REMOTE_CHANGED) {
                                throw new BuildException(String.format("%s - Status '%s'", errorPrefix, status.name()));
                        }
                }
        }
1130939
def handle_error(self, error, req, schema, error_status_code, error_headers):
        
        status_code = error_status_code or self.DEFAULT_VALIDATION_STATUS
        if status_code == 422:
            reason = "Unprocessable Entity"
        else:
            reason = None
        raise HTTPError(
            status_code,
            log_message=str(error.messages),
            reason=reason,
            messages=error.messages,
            headers=error_headers,
        )
433602
def validate(context_name = default_validation_context)
      errors.clear
      validation_violations(context_name).each { |v| errors.add(v) }

      self
    end
954367
def error(bot, update, error):
    """"""
    logger.error('Update {} caused error {}'.format(update, error), extra={"tag": "err"})
949920
function validateExclusion(attr, conf, err) {
    if (nullCheck.call(this, attr, conf, err)) return;

    if (~conf.in.indexOf(this[attr])) {
        err();
    }
}
405907
def handle_flush_error(cls, exception):
        """"""

        trace = exception.args[0]
        m = re.match(cls.MYSQL_FLUSH_ERROR_REGEX, trace)

        if not m:
            raise exception

        entity = m.group('entity')
        eid = m.group('eid')

        raise AlreadyExistsError(entity=entity, eid=eid)
1269694
private void validationFailed(FacesContext context) {
        Map<Object, Object> callbackParams = (Map<Object, Object>) context.getAttributes().get("CALLBACK_PARAMS");
        if(callbackParams == null) {
            callbackParams = new HashMap<>();
            callbackParams.put("CALLBACK_PARAMS",callbackParams);
        }
        callbackParams.put("validationFailed",true);

    }
91237
function ValidatorError (path, type) {
  var msg = type
    ? '"' + type + '" '
    : '';
  NeopreneError.call(this, 'Validator ' + msg + 'failed for path ' + path);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'ValidatorError';
  this.path = path;
  this.type = type;
}
606326
function (field, error) {

                if (field instanceof Object) {
                    this.$errors.set(field);
                } else {
                    this.$errors.set(field, error);
                }

                this.trigger('isValidChanged');
            }
100811
function (model, options) {
    var error = options.error;
    options.error = function(resp) {
      if (error) error(model, resp, options);
      model.trigger('error', model, resp, options);
    };
  }
396288
def validate_commit_range(repo_dir, old_commit, new_commit):
    """"""
    # Are there any commits between the two commits that were provided?
    try:
        commits = get_commits(repo_dir, old_commit, new_commit)
    except Exception:
        commits = []
    if len(commits) == 0:
        # The user might have gotten their commits out of order. Let's flip
        # the order of the commits and try again.
        try:
            commits = get_commits(repo_dir, new_commit, old_commit)
        except Exception:
            commits = []
        if len(commits) == 0:
            # Okay, so there really are no commits between the two commits
            # provided by the user. :)
            msg = ("The commit range {0}..{1} is invalid for {2}."
                   "You may need to use the --update option to fetch the "
                   "latest updates to the git repositories stored on your "
                   "local computer.".format(old_commit, new_commit, repo_dir))
            raise exceptions.InvalidCommitRangeException(msg)
        else:
            return 'flip'

    return True