- Модуль: seo
- Путь к файлу: ~/bitrix/modules/seo/lib/webhook/service.php
- Класс: BitrixSeoWebHookService
- Вызов: Service::answerError
static function answerError($code = null, $text = null)
{
if (!$code)
{
$code = self::ANSWER_ERROR_SYSTEM;
}
if (!$text)
{
$errorMessages = array(
self::ANSWER_ERROR_SYSTEM => 'Error.',
self::ANSWER_ERROR_NO_CODE => 'Parameter `code` not found.',
self::ANSWER_ERROR_NO_EXT_ID => 'Parameter `externalId` not found.',
self::ANSWER_ERROR_NO_SEC_CODE => 'Parameter `sec` not found.',
self::ANSWER_ERROR_WRONG_SEC_CODE => 'Wrong `sec` parameter.',
);
$text = $errorMessages[$code];
}
self::answer(array(
'error' => array('code' => $code, 'text' => $text),
'data' => array()
));
}