Split from T209285
In includes/installer/DatabaseInstaller.php method doUpgrade(), the call to $up->purgeCache() is not done inside the try/catch block. This means that if an error occurs in this step, the error is not output correctly, and furthermore the code to stop the ajax spinner is never run.
GCI instructions
---------
* Verify that you can trigger the issue locally, so you know if you successfully fixed it:
** Download and setup a local copy of mediawiki
** Artificially add a syntax error to trigger the issue. Go to includes/installer/DatabaseUpdater.php method purgeCache(). on around line 1068 change `$this->db->delete( 'objectcache', '*', __METHOD__ );` to `$this->db->delete( 'objAFafds', '*', __METHOD__ );` (Don't forget to change this back after you are done testing)
** Once mediawiki is installed, go in your webbrowser to http://127.0.0.1/path/to/my/wiki/mw-config (If using vagrant, that will likely be http://localhost:8080/w/mw-config )
** Put in your upgrade key (It should be in LocalSettings.php) and follow steps to do a db upgrade.
** Check that you can reproduce the bad behaviour (i.e. The spinner never stops, and the error message has a bunch of html in it that is shown directly)
*Now, fix the issue:
** in includes/installer/DatabaseInstaller.php in the doUpgrade() method, ensure that the call to `$up->purgeCache()` is inside the try{} block.
*Retest the issue again. Make sure that now you still get an error, but the error doesn't have any weird formatting and that the spinner stops spinning once the error is encountered.