From 76663a22f798971f68266ff2bb4f118549e2aa79 Mon Sep 17 00:00:00 2001 From: LukBukkit Date: Fri, 16 Nov 2018 23:54:59 +0100 Subject: [PATCH] Improve display of an SQL error during the installation This commit moves the call of the DatabaseUpdater::purgeCache function into a try catch block which ensures that the error will be displayed nicely. Bug: T209341 Change-Id: I614444140e29948c41baa30dd557483b63f21a9a --- includes/installer/DatabaseInstaller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index e6ee70edfd..a146ae4ae8 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -382,6 +382,7 @@ abstract class DatabaseInstaller { $up = DatabaseUpdater::newForDB( $this->db ); try { $up->doUpdates(); + $up->purgeCache(); } catch ( MWException $e ) { echo "\nAn error occurred:\n"; echo $e->getText(); @@ -391,7 +392,6 @@ abstract class DatabaseInstaller { echo $e->getMessage(); $ret = false; } - $up->purgeCache(); ob_end_flush(); return $ret; -- 2.20.1