Set a custom error on the form

@param $param
@param $message
@param bool|false $translate
@param array $translationParams
17043
public function setError($param, $message, $translate = false, $translationParams = array())
    {
        $this->errors[] = new FormError($param, $message, $translate, $translationParams);

        // Call isValid to update valid status in restore data handlers
        $this->isValid();
    }
979110
protected function addErrorsToValidator($validator, $parameters, $name, $locale)
    {
        $rule = 'unique_translation';
        $message = $this->getFormattedMessage($validator, $rule, $parameters, $name, $locale);

        $validator->errors()
            ->add($name, $message)
            ->add("{$name}.{$locale}", $message);
    }
1194743
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
    {
        $this->error = [
            'error' => $message,
            'detail' => $detail,
            'smtp_code' => $smtp_code,
            'smtp_code_ex' => $smtp_code_ex,
        ];
    }
1142194
public function setMessage($message, $param=null)
    {
        if ($param) {
            $message = sprintf($message, $param);
        }
        $this->message = $message;
        
        return $this;
    }
399283
protected function generate_error_message( $rule, $key, $params )
	{
		$params = $this->get_error_message_params( $key, $params );
		return __( ClanCats::$config->get( 'validation.language_prefix' ).'.'.$rule, $params );
	}
16157
public static function __($message, $params = [], $language = null)
    {
        return Yii::t(static::$defaultContext, $message, $params, $language);
    }
784112
@Deprecated
    public void error(Object message, Object[] params) {
        doLog(Level.ERROR, FQCN, message, params, null);
    }
440479
public function error($message, $args=array())
    {
        $backtrace        = debug_backtrace();
        $args['FILENAME'] = $backtrace[0]['file'];
        $args['LINENO']   = $backtrace[0]['line'];
        $this->log($message, $args, 'LOG_ERR');

    }
340469
public function set($messageId, $translation)
    {
        if (is_array($translation)) {
            $this->messages[$messageId] = $translation;
        } else {
            if (! isset($this->messages[$messageId])) {
                $this->messages[$messageId] = array();
            }
            $this->messages[$messageId][] = $translation;
        }
    }
226794
public function error($message, array $context = []) : void
    {
        /** @psalm-suppress UndefinedClass */
        SspLogger::error($message.($context ? " ".var_export($context, true) : ""));
    }
248323
public void error(String loggerFqcn, Object message, Object[] params, Throwable t) {
        doLog(Level.ERROR, loggerFqcn, message, params, t);
    }
652776
protected static function buildErrorMessage(
        array $params,
        string $key,
        $message = null,
        $context = null
    ): string {
        if (empty($message)) {
            $message = 'There was an error with a key: (' . $key . ')'
                . ' in params: (' . json_encode($params, 0, 3) . ')';
        }

        $contextType = gettype($context);

        if (is_object($context)) {
            $context = get_class($context);
        }

        if ($context === null) {
            return $message;
        }

        // Clear json_last_error()
        json_encode(null);

        $json = json_encode($context, JSON_PRETTY_PRINT, self::$depth);

        if (JSON_ERROR_NONE !== json_last_error()) {
            return $message;
        }

        return $message . " - Context ({$contextType}): \n" . $json;
    }
738690
protected function translate($message, $parameters = array())
    {
        return $this->translator->trans($message, $parameters, $this->translationDomain);
    }
1033580
public function setError($type, $message) {
        switch ($type) {
            case 'q':
                $this->error = array('QueryBuilderError' => $message);
                break;
            case 'd':
                $this->error = array('DatabaseError' => $message);
                break;
            default:
                $this->error = array('Error' => $message);
        }
    }
892183
protected function notifyError($message, array $params = [], $domain = null)
    {
        /** @Ignore */
        $this->notify($message, $params, $domain, Notification::STATE_ERROR);
    }
773000
public function error($message)
    {
        $this->_errors[] = $this->log_timestamp() . $message . PHP_EOL;
        $this->debug('ERROR: '.$message);
    }
1373902
public static function addErrorMessage($message, $num = E_USER_ERROR, $file = '', $line = 0, $context = array())
	{
		if (is_array($message)) {
			$message = implode(' ', $message);
		}
		$exception = new \ErrorException($message, 0, $num, $file, $line);
		$exception->context = $context;

		return self::addError($exception, true);
	}