Sets a validation error for this object. Sets $this->_isValid to false.

@param string $field
@param string $errorMessage
@return void
195460
public function addValidationError($field, $errorMessage)
    {
        $this->_isValid = false;
        $this->_validationErrors[$field] = $errorMessage;
    }
917286
public function setError($field, $message) {

    	$instance = $this -> getMessageInstance();

    	$instance :: setFieldnames([$field]);
		$instance :: setError($this -> getPrefix(), $field, $message);

		$this -> setPasses(false);

    	return $this;
    }
1184804
protected function setErrorMessage($attribute, $errorMessage)
    {
        if (!isset($this->errorMessages[$attribute])) {
            $this->errorMessages[$attribute] = [];
        }

        $this->errorMessages[$attribute][] = $errorMessage;
    }
528182
public function validate(Validation $validation, $field) : bool
    {
        if (!is_string($field)) {
            throw new Exception(
                "Field name must be a string"
            );
        }



        $label = $this->getOption("label");

        if (empty($label)) {
            $label = $validation->getLabel($field);
        }



        $value = $validation->getValue($field);

        if ($this->isSetOption("allowEmpty") && empty($value)) {
            return true;
        }



        if (!preg_match('/^[a-zA-Z0-9\-]+$/i', $value)) {
            $message = $this->getOption("message");

            if (empty($message)) {
                $message = "Field :field is not in a valid slug format";
            }



            $replacePairs = [
                ":field" => $label,
            ];

            $validation->appendMessage(
                new Message(
                    strtr($message, $replacePairs),
                    $field,
                    "Slug"
                )
            );

            return false;
        }

        return true;
    }
619708
public function validateUnique(array $values, $errorMessage, $errorField = null)
    {
        if (count($values) != count(array_unique($values))) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
639872
public function reportError(string $error_message) : void
    {
        $error_message = sprintf($error_message, $this->field_name);
        if (null != $this->validation_set) {
            $this->validation_set->addValidationError(new ValidationError($this->field_name, $error_message));
        }
    }
424605
protected function addError($field , $message) {
        if(array_key_exists($field, $this->errors)) {
            $this->errors[$field][] = $message;
        } else {
            $this->errors[$field] = [$message];
        }
        return $this;
    }
613798
public function setValidationError(CoverFishResult $coverFishResult, $errorCode, $errorMessage = null)
    {
        // skip validation if incoming mapping result is already invalid!
        if (false === $coverFishResult->isPass()) {
            return $coverFishResult;
        }

        $coverFishResult->setPass(false);
        $coverFishResult->addError(new CoverFishMessageError($errorCode, $errorMessage));

        return $coverFishResult;
    }
567229
public void rejectValue(final String field, final String errorCode, 
            final Map<String, Object> messageVariables, final String defaultMessage) {
        
        rejectValue(field, null, errorCode, Collections.emptyMap(), defaultMessage);
        
    }
1340697
protected function handleError( $errorCode, $errorMessage, $query )
	{
		if( $this->errorLevel )
		{
			$log = new \FS_File_Log_Writer( $this->logFile );
			$log->note( "[".$errorCode.": ".$errorMessage." in EXECUTE (\"".$query."\")]" );
			if( $this->errorLevel == 2 )
				trigger_error( $errorCode.": ".$errorMessage." in EXECUTE (\"".$query."\")", E_USER_WARNING );
			else if( $this->errorLevel == 3 )
				trigger_error( $errorCode.": ".$errorMessage." in EXECUTE (\"".$query."\")", E_USER_ERROR );
			else if( $this->errorLevel == 4 )
				throw new \Exception( $errorCode.": ".$errorMessage." in EXECUTE (\"".$query."\")" );
		}
	}
606326
function (field, error) {

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

                this.trigger('isValidChanged');
            }
1188010
public synchronized void setJobAsFailed(String errorMessage) {
    mJobInfo.setStatus(Status.FAILED);
    mJobInfo.setErrorMessage(errorMessage);
  }
1265807
private function callAfterFieldValidationMethod(Field $field)
    {
        $functionName = lcfirst($field->getName() . 'Validated');

        if (method_exists($this, $functionName)) {
            call_user_func([$this, $functionName]);
        }
    }
818618
public function setInvalidMessage(string $invalidMessage = null, array $invalidMessageParameters = []): void
    {
        $this->invalidMessage = $invalidMessage;
        $this->invalidMessageParameters = $invalidMessageParameters;
    }
545198
protected function setErrorInvalid($field, $label)
    {
        $error = $this->translation->text('@field has invalid value', array('@field' => $label));
        return $this->setError($field, $error);
    }
142323
protected void validateRegex(String field, String regExpression, String errorKey, String errorMessage) {
		validateRegex(field, regExpression, true, errorKey, errorMessage);
	}
747380
protected void applyErrorMessage(@Nullable CharSequence errorMessage) {
        if (mErrorView instanceof TextView) {
            ((TextView) mErrorView).setText(errorMessage);
        }
    }