• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/application.php
  • Класс: BitrixMainApplication
  • Вызов: Application::initializeExceptionHandler
protected function initializeExceptionHandler()
{
	$exceptionHandler = new DiagExceptionHandler();

	$exceptionHandling = ConfigConfiguration::getValue("exception_handling");
	if ($exceptionHandling == null)
		$exceptionHandling = array();

	if (!isset($exceptionHandling["debug"]) || !is_bool($exceptionHandling["debug"]))
		$exceptionHandling["debug"] = false;
	$exceptionHandler->setDebugMode($exceptionHandling["debug"]);

	if (!empty($exceptionHandling['track_modules']) && is_array($exceptionHandling['track_modules']))
	{
		$exceptionHandler->setTrackModules($exceptionHandling['track_modules']);
	}

	if (isset($exceptionHandling["handled_errors_types"]) && is_int($exceptionHandling["handled_errors_types"]))
		$exceptionHandler->setHandledErrorsTypes($exceptionHandling["handled_errors_types"]);

	if (isset($exceptionHandling["exception_errors_types"]) && is_int($exceptionHandling["exception_errors_types"]))
		$exceptionHandler->setExceptionErrorsTypes($exceptionHandling["exception_errors_types"]);

	if (isset($exceptionHandling["ignore_silence"]) && is_bool($exceptionHandling["ignore_silence"]))
		$exceptionHandler->setIgnoreSilence($exceptionHandling["ignore_silence"]);

	if (isset($exceptionHandling["assertion_throws_exception"]) && is_bool($exceptionHandling["assertion_throws_exception"]))
		$exceptionHandler->setAssertionThrowsException($exceptionHandling["assertion_throws_exception"]);

	if (isset($exceptionHandling["assertion_error_type"]) && is_int($exceptionHandling["assertion_error_type"]))
		$exceptionHandler->setAssertionErrorType($exceptionHandling["assertion_error_type"]);

	$exceptionHandler->initialize(
		array($this, "createExceptionHandlerOutput"),
		array($this, "createExceptionHandlerLog")
	);

	ServiceLocator::getInstance()->addInstance('exceptionHandler', $exceptionHandler);
}