[ticket/16292] Try to propagate serious errors to the installer UI

Only raise a runtime exception during install/update as a last resort.

PHPBB3-16292
This commit is contained in:
Patrick Webster 2021-05-02 16:29:31 -05:00
parent 3e0b20820a
commit 62a45d86ec

View file

@ -93,7 +93,18 @@ function installer_msg_handler($errno, $msg_text, $errfile, $errline)
case E_USER_ERROR:
$msg = '<b>General Error:</b><br>' . $msg_text . '<br> in file ' . $errfile . ' on line ' . $errline . '<br><br>';
throw new \phpbb\exception\runtime_exception($msg);
try
{
/** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
$iohandler = $phpbb_installer_container->get('installer.helper.iohandler');
$iohandler->add_error_message($msg);
$iohandler->send_response(true);
exit();
}
catch (\phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception $e)
{
throw new \phpbb\exception\runtime_exception($msg);
}
break;
case E_DEPRECATED:
return true;