• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_history.php
  • Класс: CVoxImplantHistory
  • Вызов: CVoxImplantHistory::DownloadAgentRequestErrorHandler
static function DownloadAgentRequestErrorHandler(
	int $historyID,
	string $recordUrl,
	bool $attachToCrm,
	bool $retryOnFailure,
	BitrixMainWebHttpClient $httpClient,
	string $logMessage
)
{
	if($retryOnFailure)
	{
		$recordUrl = BitrixMainWebUri::urnEncode($recordUrl);
		CAgent::AddAgent(
			"CVoxImplantHistory::DownloadAgent('{$historyID}','" . EscapePHPString($recordUrl, "'") . "','{$attachToCrm}', false);",
			'voximplant',
			'N',
			60,
			'',
			'Y',
			ConvertTimeStamp(time() + CTimeZone::GetOffset() + 60, 'FULL')
		);
	}

	$errors = [];
	foreach($httpClient->getError() as $code => $message)
	{
		$errors[] = $code . ": " . $message;
	}
	$error = !empty($errors) ? implode("; " , $errors) : $httpClient->getStatus();

	static::WriteToLog($logMessage . $recordUrl . "; Error: " . $error);
}