Merge::getErrorByCode

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Merge
  4. getErrorByCode
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/agent/duplicate/background/merge.php
  • Класс: Bitrix\Crm\Agent\Duplicate\Background\Merge
  • Вызов: Merge::getErrorByCode
protected function getErrorByCode(int $errorCode): Error
{
	$errorMessage = '';

	switch ($errorCode)
	{
		case static::ERR_ALREADY_RUNNING:
			$errorMessage = $this->getMessage('CRM_AGNT_DUP_BGRND_MERGE_ERR_ALREADY_RUNNING');
			break;
		case static::ERR_NOT_RUNNING:
			$errorMessage = $this->getMessage('CRM_AGNT_DUP_BGRND_MERGE_ERR_NOT_RUNNING');
			break;
		case static::ERR_NOT_STOPPED:
			$errorMessage = $this->getMessage('CRM_AGNT_DUP_BGRND_MERGE_ERR_NOT_STOPPED');
			break;
	}

	if ($errorMessage === '')
	{
		return parent::getErrorByCode($errorCode);
	}

	return new Error($errorMessage, $errorCode);
}

Добавить комментарий