method public final

Component::getErrorByCode()

Класс: \Bitrix\Main\Engine\Response\Component

Сигнатура

public final getErrorByCode(string $code) : Error

Описание

Получение единственной ошибки с необходимым кодом.

Параметры

$code string
Код ошибки.

Возвращаемое значение

Error

Как применяется в Component

Component::getErrorByCode() — метод класса \Bitrix\Main\Engine\Response\Component модуля «Главный модуль». Component: Тип ответа для рендеринга ajax-html-контента из действия.

Метод объекта: сначала нужен экземпляр Component.

use Bitrix\Main\Engine\Response\Component;

/** @var Component $object */
$code = '';
$result = $object->getErrorByCode($code);
// $result: Error

Другие методы Component

getErrorByCode() есть и у других классов модуля «Главный модуль»: Action, AjaxJson, Authentication, Base, CloseSession, ClosureAction, ClosureWrapper, ComponentController.

Исходный файл: source/main/lib/engine/response/component.php:89

Что будем искать? Например,Продвижение