Creates a validation error
423889
def build_errors(type, category = nil, row = nil, column = nil, content = nil, constraints = {})
      @errors << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints)
    end
140476
def assert_error(text, check, n=1):
    """"""
    assert_error.description = "No {} error for '{}'".format(check, text)
    assert(check in [error[0] for error in lint(text)])
1036768
def error(self, instance, value, error_class=None, extra=''):
        
        error_class = error_class or ValidationError
        prefix = 'The {} property'.format(self.__class__.__name__)
        if self.name != '':
            prefix = prefix + " '{}'".format(self.name)
        if instance is not None:
            prefix = prefix + ' of a {cls} instance'.format(
                cls=instance.__class__.__name__,
            )
        print_value = repr(value)
        if len(print_value) > 107:
            print_value = '{}  ...  {}'.format(
                print_value[:50], print_value[-50:]
            )
        message = (
            '{prefix} must be {info}. An invalid value of {val} {vtype} was '
            'specified.{extra}'.format(
                prefix=prefix,
                info=self.info or 'corrected',
                val=print_value,
                vtype=type(value),
                extra=' {}'.format(extra) if extra else '',
            )
        )
        if issubclass(error_class, ValidationError):
            raise error_class(message, 'invalid', self.name, instance)
        raise error_class(message)
1084271
def create(data=None, id=None, message=None):
        

        return Error(
            data=data,
            id=id,
            message=message,
        )
770149
function createError(status, message) {
  var err = new Error(message);
  err.status = status;
  return err;
}
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 {}
    )
565575
def add_error_handlers(app):
    """"""

    def handle_validation_error(error):
        response = jsonify({'message': str(error)})
        response.status_code = error.status_code
        return response

    app.errorhandler(ValidationError)(handle_validation_error)
352194
function(code, message, field){
            return new Validator.Error({
                code: code,
                message: message,
                field: field
            });
        }
1205904
def validate(self, value, add_comments=False, schema_name="map"):
        
        validator = self.get_schema_validator(schema_name)

        error_messages = []

        if isinstance(value, list):
            for d in value:
                error_messages += self._validate(d, validator, add_comments, schema_name)
        else:
            error_messages = self._validate(value, validator, add_comments, schema_name)

        return error_messages
1326587
function ValidationError (instance) {
  NeopreneError.call(this, "Validation failed");
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'ValidationError';
  this.errors = instance.errors = {};
}
1149537
function validatorError( message , element ) {
	var error = new doormen.ValidatorError( message , element ) ;

	this.validate = false ;

	if ( this.report ) {
		this.errors.push( error ) ;
	}
	else {
		throw error ;
	}
}
1360198
def _error(self, message, start, end=None):
        """"""
        raise errors.EfilterParseError(
            source=self.source, start=start, end=end, message=message)
966096
function makeError(id, msg, err) {
        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
        if (err) {
            e.originalError = err;
        }
        return e;
    }
73476
def _validate_constraints(constraints, label, add_error):
    
    if constraints is None:
        return
    msg = '{} has invalid constraints {}'.format(label, constraints)
    if not isstring(constraints):
        add_error(msg)
        return
    sep = ',' if ',' in constraints else None
    for constraint in constraints.split(sep):
        try:
            key, value = constraint.split('=')
        except (TypeError, ValueError):
            add_error(msg)
            return
        if key not in _CONSTRAINTS:
            add_error(msg)
1320471
function makeError(jqXHR, textStatus, errorThrown, options) {
    var Constructor = statusToError[textStatus];

    // We did not find anything in the map, which would happen if the textStatus
    // was "error". Determine whether an ``HttpError`` or an ``AjaxError`` must
    // be thrown.
    if (!Constructor) {
      Constructor = statusToError[(jqXHR.status !== 0) ? "http" : "ajax"];
    }

    return new Constructor(jqXHR, textStatus, errorThrown, options);
  }
250102
def error(message)
      (m = filter(message, :error)) && each {|l| l.error(m)}
    end
367039
function makeError(e) {
    return {
      fatal: true,
      severity: 2,
      message: (e.message || '').split('\n', 1)[0],
      line: parser.line,
      column: parser.column
    };
  }