Add errors.

@param Collection $errors

@return $this
962094
public function addErrors(Collection $errors)
    {
        $this->errors = $this->getErrors()->merge($errors);

        return $this;
    }
727064
public function error($errors = false)
    {
        if ($errors === false) {
            return $this->error;
        } else {
            if (is_array($errors) === true) {
                foreach ($erros as $error) {
                    $this->error($error);
                }
            }
        }
        $this->error[] =(string) $errors;
    }
75398
public function add($collection)
    {
        if (!is_array($collection) and !($collection instanceof \Traversable)) {
            throw new \InvalidArgumentException(self::MSG_NOT_ITERABLE, 230);
        }
        
        foreach ($collection as $name => $closure) {
            $this->set($name, $closure);
        }
        
        return $this;
    }
653326
public function addError(ErrorInterface $error)
    {
        // create a local copy of the error stack
        $errors = $this->errors;

        // append the error to the stack
        $errors[] = $error;

        // copy the error stack back to the thread context
        $this->errors = $errors;
    }
135235
protected function validateOnPost(ErrorCollection $errors)
    {
        $this->validateData([
            Schema::KEYWORD_ID => $this->getId(),
        ], [
            Schema::KEYWORD_ID => 'required|unique:' . Model::TABLE_NAME . ',' . Model::FIELD_ID,
        ], $errors);

        $this->validateAttributes([
            Schema::ATTR_NAME => 'required|max:' . Model::LENGTH_NAME,
        ], $errors);
    }
424605
protected function addError($field , $message) {
        if(array_key_exists($field, $this->errors)) {
            $this->errors[$field][] = $message;
        } else {
            $this->errors[$field] = [$message];
        }
        return $this;
    }
57002
public function setErrors($errors) 
	{
		if(is_array($errors)) {
			$this->errors = $errors;
			return $this;
		}
		
		$args = func_get_args();
		$this->errors[$args[0]] = $args[1];
		
		return $this;
	}
1084419
public function addError($error) {
		if ($error instanceof \Exception) {
			$error = $error->getMessage();
		}

		$this->messages['errors'][] = $error;
		$this->saveSession();
	}
290038
public function addManyToManyCollections($collections)
    {
        if (!is_array($collections)) {
            $collections = [$collections];
        }
        $this->manyToManyCollections = array_merge($this->manyToManyCollections, $collections);

        return $this;
    }
118625
private function set_errors( $errors )
    {
        if( count( $errors ) == 0 )
        {
            return;
        }
        
        $errors_array = array();
        foreach( $this->config->get_sections() as $section )
        {
            foreach( $section->get_fields() as $component )
            {
                if( $component instanceof \Amarkal\UI\ValidatableComponentInterface && $errors[$component->get_name()] )
                {
                    $errors_array[] = array(
                        'section'=> $section->get_slug(),
                        'message'=> $errors[$component->get_name()]
                    );
                }
            }
        }
        State::set('errors', $errors_array);
    }
399538
public function withErrors($errors, $message = null)
    {
        if (! $errors instanceof MessageBag) {
            $errors = new MessageBag((array) $errors);
        }

        if (! is_null($message)) {
            $errors->add('__message', $message);
        }

        $this->with('errors', $errors->toArray());

        return $this;
    }
832033
public function withError($message)
    {
        if (is_array($message)) {
            $this->errorBag->setErrors($message);
        } else {
            $this->errorBag->add($message);
        }

        return $this;
    }
1340371
private function importErrors(array $errors): void
    {
        foreach ($errors as $field => $errors) {
            foreach ($errors as $message) {
                $this->addError($message, $field);
            }
        }
    }
579439
protected function setErrors(\Asgard\Validation\Report $errors) {
		foreach($errors->attributes() as $name=>$_errors) {
			if(isset($this->fields[$name]))
				$this->fields[$name]->setErrors($_errors);
		}
	}
343032
public function notExist($error) {
        if ($this->_exist) {
            array_push($this->_constraints, ['type' => self::NOTEXIST, 'message' => $error]);
        }

        return $this;
    }
501305
public function addError($error)
    {
        if (is_array($error)) {
            $this->errors += $error;
        } else {
            $this->errors[] = $error;
        }

        return $this;
    }
204233
def add_errors(errors)
      errors.each do |error|
        if error.respond_to?(:message)
          self.errors.add(error.field, error.message)
        elsif error.respond_to?(:messages)
          error.messages.each do |message|
            self.errors.add(error.field, message)
          end
        end
      end
    end