mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 11:38:52 +00:00
[ticket/17525] Correctly handle Doctrine DB tools exceptions, enrich error info
PHPBB-17525
This commit is contained in:
parent
e34e1759c7
commit
8d1f8af7c6
5 changed files with 27 additions and 27 deletions
|
@ -276,6 +276,12 @@ class acp_extensions
|
|||
{
|
||||
$this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$stack_trace = phpbb_filter_root_path(str_replace("\n", '<br>', $e->getTraceAsString()));
|
||||
$message = $e->getMessage();
|
||||
$this->template->assign_var('MIGRATOR_ERROR', '<b>' . $message . '</b><br><br>' . $stack_trace);
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_ext_enable';
|
||||
|
||||
|
|
|
@ -2716,7 +2716,7 @@ function get_backtrace()
|
|||
// Only show function arguments for include etc.
|
||||
// Other parameters may contain sensible information
|
||||
$argument = '';
|
||||
if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once')))
|
||||
if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once', 'try_apply')))
|
||||
{
|
||||
$argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0]), ENT_COMPAT);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ function installer_msg_handler($errno, $msg_text, $errfile, $errline): bool
|
|||
{
|
||||
/** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
|
||||
$iohandler = $phpbb_installer_container->get('installer.helper.iohandler');
|
||||
$iohandler->add_error_message($msg);
|
||||
$iohandler->add_error_message($msg, get_backtrace());
|
||||
$iohandler->send_response(true);
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -457,8 +457,6 @@ class doctrine implements tools_interface
|
|||
* @return bool|string[]
|
||||
*/
|
||||
protected function alter_schema(callable $callback)
|
||||
{
|
||||
try
|
||||
{
|
||||
$current_schema = $this->get_schema();
|
||||
$new_schema = clone $current_schema;
|
||||
|
@ -481,12 +479,6 @@ class doctrine implements tools_interface
|
|||
|
||||
return true;
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
// @todo: check if it makes sense to properly handle the exception
|
||||
return [$e->getMessage()];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter table.
|
||||
|
|
|
@ -280,7 +280,9 @@ class installer
|
|||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->iohandler->add_error_message($e->getMessage());
|
||||
$stack_trace = phpbb_filter_root_path(str_replace("\n", '<br>', $e->getTraceAsString()));
|
||||
$message = $e->getMessage();
|
||||
$this->iohandler->add_error_message($message, $stack_trace);
|
||||
$this->iohandler->send_response(true);
|
||||
$fail_cleanup = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue