• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/diag/httpexceptionhandleroutput.php
  • Класс: BitrixMainDiagHttpExceptionHandlerOutput
  • Вызов: HttpExceptionHandlerOutput::renderExceptionMessage
public function renderExceptionMessage($exception, $debug = false)
{
	$response = new MainHttpResponse();
	$response->setStatus('500 Internal Server Error');
	$response->writeHeaders();

	if ($debug)
	{
		echo ExceptionHandlerFormatter::format($exception, true);
	}
	else
	{
		$p = MainIOPath::convertRelativeToAbsolute("/error.php");
		if (MainIOFile::isFileExists($p))
		{
			include($p);
		}
		else
		{
			$application = MainApplication::getInstance();
			if ($application)
			{
				echo MainLocalizationLoc::getMessage("eho_render_exception_message");
			}
			else
			{
				echo "A error occurred during execution of this script. You can turn on extended error reporting in .settings.php file.";
			}
		}
	}
}