• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/api/api.php
  • Класс: BitrixSaleTradingPlatformVkApiApi
  • Вызов: Api::checkError
private function checkError($method, $params)
{
//		check limit of requests count. If limit catched - run again
	if ($this->checkRequestsLimit())
	{
		return $this->run($method, $params);
	}
//		FATAL errors - stop running
	if (isset($this->response["error"]))
	{
		$logger = new VkLogger($this->exportId);
		$logger->addLog(
			'Catch error in method ' . $method,
			array('ERROR' => $this->response["error"] . ' - ' . $this->response["error_msg"], "PARAMS" => $params)
		);
		$logger->addError($this->response["error"]["error_code"], $method);
		
		throw new VkExecuteException("VK_critical_execution_error " . $this->response["error"]["error_code"] . " in method " . $method);
	}

//		EXECUTE errors can be fatal or not critical
	if (isset($this->response["execute_errors"]))
	{
		$logger = new VkLogger($this->exportId);
		foreach ($this->response["execute_errors"] as $er)
		{
			$logger->addLog(
					'Execute error in method ' . $method,
					array('ERROR' => $er["error_code"] . ' (' . $er["method"] . ') - ' . $er["error_msg"], "PARAMS" => $params,
						"RESPONSE" => $this->response)
			);
			$logger->addError($er["error_code"]);
		}
	}
	
	return NULL;
}