3namespace Bitrix\Location\Infrastructure\Service;
5use Bitrix\Location\Common\BaseService;
6use Bitrix\Location\Exception\ErrorCodes;
7use Bitrix\Location\Infrastructure\Service\Config\Container;
8use Bitrix\Location\Infrastructure\Service\LoggerService\LogLevel;
10use Bitrix\Main\ErrorCollection;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\SystemException;
14Loc::loadMessages(__FILE__);
40 $this->errorCollection[] =
$error;
47 if($this->throwExceptionOnError)
50 Loc::getMessage(
'LOCATION_ISTRUCTURE_ERRORSERVICE_ERROR'),
51 ErrorCodes::ERRORSERVICE_ERROR_WAS_HAPPENED
74 $this->errorCollection->clear();
98 return $this->errorCollection->count() > 0;
108 $this->logErrors =
$config->get(
'logErrors');
109 $this->throwExceptionOnError =
$config->get(
'throwExceptionOnError');
__construct(Container $config)
setLogErrors(bool $logErrors)
setThrowExceptionOnError(bool $throwExceptionOnError)