Add an error to the internal error array

@param string $errorKey   The key to use for the error
@param string $errorValue The description of the error
188787
public function addError($errorKey, $errorValue)
    {
        if (!isset($this->errors[$errorKey])) {
            $this->errors[$errorKey] = [];
        }
        $this->errors[$errorKey][] = $errorValue;
    }
1215966
public void setErrorMessage(String errorMessage) {

        m_errorMessage = errorMessage;
        m_errorLabel.setValue(errorMessage != null ? errorMessage : "");
    }
570695
protected function _setValidationErrors($errorList)
    {
        if (!is_null($errorList)) {
            $errorList = $this->_normalizeIterable($errorList);
        }

        $this->validationErrors = $errorList;
    }
426032
public void error(String key, Object ... args) {
        error(diags.errorKey(key, args));
    }
674540
public function setError($errorCode = null, $message = null):ErrorResponseBuilder
    {
        $this->errorCode = $errorCode;

        if (is_array($message)) {
            $this->parameters = $message;
        } else {
            $this->message = $message;
        }

        return $this;
    }
1244848
private function checkForConnectionErrors(int $errorCode, string $errorDescription): self
    {
        if ($errorCode !== 0 || $this->socket === null) {
            $this->logger->critical('Could not connect to broker', [
                'errorCode' => $errorCode,
                'errorDescription' => $errorDescription,
            ]);

            throw new NotConnected('Could not connect to broker: ' . $errorDescription, $errorCode);
        }

        return $this;
    }
1003165
final public static function exceptionDriver (int $errorCode=NULL)
	{
		switch ($errorCode) {
			case self::EMPTY_VALUE:
				throw new ErrorHandler("Empty Value.", ErrorCode::EMPTY_VALUE);
				break;
			case self::INVALID:
				throw new ErrorHandler("Value Not Valid.", ErrorCode::INVALID);
				break;
			case self::EMPTY_METHOD:
				throw new ErrorHandler("Method not parsed in RouterEngine.", ErrorCode::EMPTY_METHOD);
				break;
			case self::EMPTY_ARGUMENT:
				throw new ErrorHandler("Argument not parsed to method in RouterEngine.", ErrorCode::EMPTY_ARGUMENT);
				break;
			case self::INVALID_DIR:
				throw new ErrorHandler("Specified directory is invalid.", ErrorCode::INVALID_DIR);
				break;
			default:
				throw new ErrorHandler('Error Not Defined.', ErrorCode::THROW_NONE);
				break;
		}
		return;
	}
9125
public function ensure($key, $errorMessage = null, $scalarType = null) {
        if ( ! $this->has($key)) {
            if ($errorMessage === null) {
                $errorMessage = sprintf('Missing config at key "%s".', $key);
            } else {
                $errorMessage = s('%s: %s', $key, $errorMessage);
            }

            throw new MissingConfigException($errorMessage);
        }

        if ($scalarType !== null) {
            if ( ! str_starts_with(gettype($this->get($key)), $scalarType)) {
                $errorMessage = sprintf('%s: Config value at key "%s" should be of type "%s".', $key, $key, $scalarType);

                throw new InvalidConfigValueException($errorMessage);
            }
        }

        return $this;
    }
1216772
public function addErrorObject(ErrorObject $errorObject) {
		$this->errors[] = $errorObject;
		
		if ($errorObject->hasHttpStatusCode()) {
			$this->setHttpStatusCode($this->determineHttpStatusCode($errorObject->getHttpStatusCode()));
		}
	}
77992
public function handleError($errno, $errstr, $errfile, $errline, $errcontext) {
        throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
    }
296605
protected function translateErrorMessage($errorCode)
    {
        $message = self::UNKNOWN_ERROR_MESSAGE;

        if (isset(self::$errorMessages[$errorCode])) {
            $message = self::$errorMessages[$errorCode];
        }

        return $message;
    }
1157625
protected final void addError(String msgKey, Object... args) {
    getFlash().addErrorNow(getTextInternal(msgKey, args));
  }
416920
def add_error(expected_value, target_value)
      @errors[target_value.error_key] = <<-MSG

        Mismatch in field: '#{target_value.error_key}'
          expected: '#{expected_value.value}'
          received: '#{target_value.value}'

      MSG
    end
456350
public function appendError($error_key, $error_string)
	{
		if($this->getErrors())
		{
			// append
			$this->errors->add( $error_key, $error_string );
		}
		else
		{
			// new MessageBag
			$this->errors = new MessageBag( array($error_key => $error_string) );
		}
	}
1054368
protected function throwNewInvalidArgumentException ($errorMsg) {
		$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
		$str = '['.$selfClass.'] ' . $errorMsg . ' (';
		if ($this->form) {
			$str .= 'form id: `'.$this->form->GetId() . '`, '
				. 'form type: `'.get_class($this->form).'`, ';
		}
		$str .= 'field type: `'.get_class($this) . '`)';
		throw new \InvalidArgumentException($str);
	}
1305163
protected function ensureIsNotEmpty($fieldName, $valueToTest, $exceptionCode = 0)
    {
        if ($valueToTest === 0 || $valueToTest === '0' || $valueToTest === false) {
            return;
        }

        if (empty($valueToTest)) {
            $message = sprintf('%s should not be empty', $fieldName);
            throw new InvalidValueException($message, $exceptionCode);
        }
    }
639065
public function setError($error, $key = null)
	{
		if ($error instanceof Exception)
		{
			$this->error = $error;
			return true;
		}

		return false;
	}