Add an error to the tree.

        :param error: :class:`~cerberus.errors.ValidationError`
559012
def add(self, error):
        
        if not self._path_of_(error):
            self.errors.append(error)
            self.errors.sort()
        else:
            super(ErrorTree, self).add(error)
782791
def error(self, instance, value, error_class=None, extra=''):
        """"""
        error_class = error_class or ValidationError
        if not isinstance(value, (list, tuple, np.ndarray)):
            super(Array, self).error(instance, value, error_class, extra)
        if isinstance(value, (list, tuple)):
            val_description = 'A {typ} of length {len}'.format(
                typ=value.__class__.__name__,
                len=len(value)
            )
        else:
            val_description = 'An array of shape {shp} and dtype {typ}'.format(
                shp=value.shape,
                typ=value.dtype
            )

        if instance is None:
            prefix = '{} property'.format(self.__class__.__name__)
        else:
            prefix = "The '{name}' property of a {cls} instance".format(
                name=self.name,
                cls=instance.__class__.__name__,
            )
        message = (
            '{prefix} must be {info}. {desc} was specified. {extra}'.format(
                prefix=prefix,
                info=self.info,
                desc=val_description,
                extra=extra,
            )
        )
        if issubclass(error_class, ValidationError):
            raise error_class(message, 'invalid', self.name, instance)
        raise error_class(message)
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)
288416
def addError(self, test, err):
        
        super().addError(test, err)
        self.test_info(test)
        self._call_test_results('addError', test, err)
1209062
def add_error(key, error, message = nil)
      if error.is_a? Symbol
        error = ErrorAtom.new(key, error, message: message)
      elsif error.is_a?(Mutations::ErrorAtom) || error.is_a?(Mutations::ErrorArray) || error.is_a?(Mutations::ErrorHash)

      else
        raise ArgumentError.new("Invalid error of kind #{error.class}")
      end

      @errors ||= ErrorHash.new
      @errors.tap do |errs|
        path = key.to_s.split(".")
        last = path.pop
        inner = path.inject(errs) do |cur_errors,part|
          cur_errors[part.to_sym] ||= ErrorHash.new
        end
        inner[last] = error
      end
    end
668184
def error(self, message, *args, **kwargs):
        
        self._log(logging.ERROR, message, *args, **kwargs)
794922
def _insert_error(self, path, node):
        
        field = path[0]
        if len(path) == 1:
            if field in self.tree:
                subtree = self.tree[field].pop()
                self.tree[field] += [node, subtree]
            else:
                self.tree[field] = [node, {}]
        elif len(path) >= 1:
            if field not in self.tree:
                self.tree[field] = [{}]
            subtree = self.tree[field][-1]

            if subtree:
                new = self.__class__(tree=copy(subtree))
            else:
                new = self.__class__()
            new._insert_error(path[1:], node)
            subtree.update(new.tree)
208980
public void addTocError(final BaseTopicWrapper<?> topic, final ErrorType errorType, final String error) {
        addItem(topic, error, ErrorLevel.ERROR, errorType);
    }
782553
def set_errors(self):
		
		if not self.field.errors or self.attrs.get("_no_errors"):
			return
		
		self.values["class"].append("error")

		for error in self.field.errors:
			self.values["errors"] += ERROR_WRAPPER % {"message": error}
1320145
def add(self, lines, message):
		
		error = Error(message)

		if error not in self.errors:
			self.errors[error] = []

		self.errors[error].extend(lines)
1261811
def _create_validation_error(self,
                                 name,                     # type: str
                                 value,                    # type: Any
                                 validation_outcome=None,  # type: Any
                                 error_type=None,          # type: Type[ValidationError]
                                 help_msg=None,            # type: str
                                 **kw_context_args):
        

        # first merge the info provided in arguments and in self
        error_type = error_type or self.error_type
        help_msg = help_msg or self.help_msg
        ctx = copy(self.kw_context_args)
        ctx.update(kw_context_args)

        # allow the class to override the name
        name = self._get_name_for_errors(name)

        if issubclass(error_type, TypeError) or issubclass(error_type, ValueError):
            # this is most probably a custom error type, it is already annotated with ValueError and/or TypeError
            # so use it 'as is'
            new_error_type = error_type
        else:
            # Add the appropriate TypeError/ValueError base type dynamically
            additional_type = None
            if isinstance(validation_outcome, Exception):
                if is_error_of_type(validation_outcome, TypeError):
                    additional_type = TypeError
                elif is_error_of_type(validation_outcome, ValueError):
                    additional_type = ValueError
            if additional_type is None:
                # not much we can do here, let's assume a ValueError, that is more probable
                additional_type = ValueError

            new_error_type = add_base_type_dynamically(error_type, additional_type)

        # then raise the appropriate ValidationError or subclass
        return new_error_type(validator=self, var_value=value, var_name=name, validation_outcome=validation_outcome,
                              help_msg=help_msg, **ctx)
719577
def error(self, request, message, extra_tags='', fail_silently=False):
        """"""
        add(self.target_name, request, constants.ERROR, message, extra_tags=extra_tags,
            fail_silently=fail_silently)
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;
}
541290
def add_error(e)
      @data[:error] = true

      if @data.key?(:ec)
        @data[:ec] = @data[:ec] + 1
      else
        @data[:ec] = 1
      end

      # If a valid exception has been passed in, log the information about it
      # In case of just logging an error for things such as HTTP client 5xx
      # responses, an exception/backtrace may not exist.
      if e
        if e.backtrace.is_a?(Array)
          add_stack(stack: e.backtrace)
        end

        if HTTP_SPANS.include?(@data[:n])
          set_tags(:http => { :error => "#{e.class}: #{e.message}" })
        else
          log(:error, Time.now, { :message => e.message, :parameters => e.class.to_s })
        end
        e.instance_variable_set(:@instana_logged, true)
      end
      self
    end
717563
def add_error(key, kind, message = nil)
      raise ArgumentError.new("Invalid kind") unless kind.is_a?(Symbol)

      @errors ||= ErrorHash.new
      @errors.tap do |errs|
        path = key.to_s.split(".")
        last = path.pop
        inner = path.inject(errs) do |cur_errors,part|
          cur_errors[part.to_sym] ||= ErrorHash.new
        end
        inner[last] = ErrorAtom.new(key, kind, :message => message)
      end
    end
886044
def add(error, group_name = :base)
      if error.is_a?(String)
        @error_messages[group_name.to_sym] << error
      elsif error.is_a?(Array)
        @error_messages[group_name.to_sym] += error
      end
    end
760536
def _add_error(self, message):
        """"""
        error_line = Result(False, None, message, Directive(""))
        self._suite.addTest(Adapter(self._filename, error_line))