Improve display of an SQL error during the installation
authorLukBukkit <luk.bukkit@gmail.com>
Fri, 16 Nov 2018 22:54:59 +0000 (23:54 +0100)
committerLukBukkit <luk.bukkit@gmail.com>
Fri, 16 Nov 2018 22:56:31 +0000 (23:56 +0100)
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

index e6ee70e..a146ae4 100644 (file)
@@ -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;