returns a array of form errors

@return      array
19698
public function getErrors()
    {
        $errors = array();

        $entityContainers = $this->getEntityContainerMap()->getAll();

        /**
         * @var EntityContainerInterface $entityContainer
         */
        foreach ($entityContainers as $entityContainer) {
            if ($entityContainer->hasErrors()) {
                $errors[$entityContainer->getName()] = $entityContainer->getErrors();
            }
        }

        return $errors;
    }
151390
public function any_error_messages() {
        $errors = array();
        foreach ($this->get_all_slots() as $slot) {
            foreach ($this->for_slot($slot)->get_sub_question_ids() as $subqid) {
                if ($this->for_subq($subqid)->differentweights) {
                    $name = $this->for_subq($subqid)->question->name;
                    $errors[] = get_string('erroritemappearsmorethanoncewithdifferentweight', 'question', $name);
                }
            }
        }
        return $errors;
    }
700657
public function getErrors($fieldName=null)
    {
        if ($fieldName === null) {
            return $this->errors;
        }

        if (isset($this->errors[$fieldName])) {
            return $this->errors[$fieldName];
        }

        return [];
    }
1161355
def get_form_errors(form):
    
    return {
        'non_field': form.non_field_errors(),
        'field_specific': OrderedDict(
            (field, form.errors[field.name])
            for field in form
            if field.name in form.errors
        )
    }
7853
public function getFlatErrors(): array
    {
        /**
         * Reducer that flat the errors.
         *
         * @param array   $carry previous error list
         * @param Invalid $item  to append to $carry
         *
         * @return array<Invalid>
         */
        $reduce = function(array $carry, Invalid $item) use(&$reduce) {
            if ($item instanceof self) {
                $carry = array_merge($carry, $item->getFlatErrors());
            } else {
                $carry[] = $item;
            }
            if ($item->getPrevious()) {
                $carry = $reduce($carry, $item->getPrevious());
            }

            return $carry;
        };

        return array_reduce($this->errors, $reduce, []);
    }
751571
protected function getError()
	{
		return $this->form->error(
			$this->model,
			$this->attribute,
			$this->errorOptions,
			$this->enableAjaxValidation,
			$this->enableClientValidation
		);
	}
1175166
public function getErrorMessages(Form $form)
    {
        $errors = '';

        foreach ($form->getErrors() as $key => $error) {
            $errors .= $error->getMessage().', ';
        }

        /** @var Form $child */
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $fieldName = $child->getConfig()->getOption('label', null);

                if (empty($fieldName)) {
                    $fieldName = $child->getName();
                }

                $errors .= sprintf("[%s] %s, ", $fieldName, $this->getErrorMessages($child));
            }
        }

        return rtrim($errors, ', ');
    }
1243398
public function getFirstErrors(): array
    {
        $errors = $this->getErrors();
        if (empty($errors)) {
            return [];
        } else {
            $errors = [];
            foreach ($errors as $name => $es) {
                if (!empty($es)) {
                    $errors[$name] = reset($es);
                }
            }

            return $errors;
        }
    }
657362
public function getFirstErrors()
    {
        $errors = array();
        foreach (array_keys($this->errors) as $name) {
            $errors[$name] = current($this->errors[$name]);
        }

        return $errors;
    }
11917
public function getErrors(): array
    {
        if ($this->errors === null) {
            $this->errors = $this->fetchErrors();
        }

        //Making sure that each error point to proper input origin
        return $this->mapper->mapErrors($this, $this->validateNested($this->errors));
    }
1115271
public function errors() : array
    {
        $errors = $this->privateErrors();
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            $name = $element->getElement()->name();
            if ($error = $element->getElement()->errors()) {
                $errors = array_merge($errors, [$name => $error]);
            }
        }
        return $errors;
    }
524935
public static function getUploadErrorMessages()
    {
        return [
            UPLOAD_ERR_OK => Module::t('upload_err_message_0'),
            UPLOAD_ERR_INI_SIZE => Module::t('upload_err_message_1'),
            UPLOAD_ERR_FORM_SIZE =>  Module::t('upload_err_message_2'),
            UPLOAD_ERR_PARTIAL =>  Module::t('upload_err_message_3'),
            UPLOAD_ERR_NO_FILE =>  Module::t('upload_err_message_4'),
            UPLOAD_ERR_NO_TMP_DIR =>  Module::t('upload_err_message_6'),
            UPLOAD_ERR_CANT_WRITE =>  Module::t('upload_err_message_7'),
            UPLOAD_ERR_EXTENSION =>  Module::t('upload_err_message_8'),
        ];
    }
16201
public static function get() : array
  {
    return [
      'csrf_token' => CSRF::generate(),
      'errors' => Variable::has('validation.errors') ? Variable::get('validation.errors') : (new ValidatorFactory())->make([], [])->errors(),
      'old' => Variable::has('form.old') ? Variable::get('form.old') : [],
    ];
  }
586750
public function get_error(){
    if ( $this->error ){
      return [
        'code' => $this->error,
        'text' => $this->class_cfg['errors'][$this->error]
      ];
    }
    return false;
  }
668385
public function getInvalidOrMissingErrors()
    {
        $all = $this->invalidAttribs + $this->missingAttribs;
        return array_combine(
            array_keys($all),
            array_map(function ($ref) {
                return $ref['error'];
            }, array_values($all))
        );
    }
982433
public function getFormErrors(FormInterface $form, $transDomain = 'System'): array
    {
        if (!$form->isSubmitted() || false) return [];

        $messages = $this->getMessageManager();

        $errorList = $this->getParser()->parseErrors($form);
        $errorList = is_array($errorList) ? $errorList: [];

        foreach($errorList as $q=>$w) {
            $errorList[$q]['messages'] = [];
            foreach($w['errors'] as $error) {
                $errorList[$q]['messages'][] = $error->getMessage();
                $messages->addMessage('danger', $error->getMessage(), [], false);
            }
        }
        if (empty($errorList))
            $messages->addMessage('success', 'All details were saved successfully.', [], 'System');

        return $messages->serialiseTranslatedMessages($this->getTranslator());
    }
177236
protected function getFormErrors(FormInterface $form)
    {
        $errors = [];
        foreach ($form->getErrors() as $error) {
            $errors[] = $error->getMessage();
        }
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $errors[$child->getName()] = $this->getFormErrors($child);
            }
        }

        return $errors;
    }