From 7f6d562aff23e167d532b8e218ef121d6fb154af Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Wed, 21 Jan 2015 13:43:35 +0000 Subject: Fatal errors during DB upgrades are not shown to the user --- includes/session.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'includes/session.php') diff --git a/includes/session.php b/includes/session.php index 7ca4df308d..1b0e4ca512 100644 --- a/includes/session.php +++ b/includes/session.php @@ -356,15 +356,11 @@ try { unset($dbconfig); // Some of the FAMILY JOIN HUSBAND JOIN WIFE queries can excede the MAX_JOIN_SIZE setting WT_DB::exec("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci', SQL_BIG_SELECTS=1"); - try { - WT_DB::updateSchema(WT_ROOT . 'includes/db_schema/', 'WT_SCHEMA_VERSION', WT_SCHEMA_VERSION); - } catch (PDOException $ex) { - // The schema update scripts should never fail. If they do, there is no clean recovery. - die($ex); - } + WT_DB::updateSchema(WT_ROOT . 'includes/db_schema/', 'WT_SCHEMA_VERSION', WT_SCHEMA_VERSION); } catch (PDOException $ex) { + WT_FlashMessages::addMessage($ex->getMessage(), 'danger'); header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'site-unavailable.php'); - exit; + throw $ex; } // The config.ini.php file must always be in a fixed location. -- cgit v1.3