Свой текст вместо "A error occurred during execution of this script..."

некрасивые тексты ошибок:
  • При выполнении скрипта возникла ошибка. Включить расширенный вывод ошибок можно в файле настроек .settings.php
  • A error occurred during execution of this script. You can turn on extended error reporting in .settings.php file.
вызывается в /bitrix/modules/main/lib/diag/exceptionhandleroutput.php

надо заменить $MESS['eho_render_exception_message']


init.php
use Bitrix\Main\Localization\Loc;
Loc::loadCustomMessages(__FILE__);
в той же папке, где init.php создать ланговые файлы
  • /lang/en/init.php
  • /lang/de/init.php
  • /lang/кг/init.php
  • /lang/другой_язык/init.php
в этих init.php
<?php
$MESS['eho_render_exception_message'] = 'Sorry, an error has occurred. Our developers are already working on it.'; //ваш текст ошибки на нужном языке