From: Aaron Schulz Date: Mon, 3 Mar 2014 21:12:11 +0000 (-0800) Subject: Commit DB changes as normal on exception-based GUI errors X-Git-Tag: 1.31.0-rc.0~16224 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=637297c7c5854d6eb7a617d12a333e5cbff698b1;p=lhc%2Fweb%2Fwiklou.git Commit DB changes as normal on exception-based GUI errors Bug: 62091 Change-Id: I36cd645d5f7a939b60f306e5fc093507693b097b --- diff --git a/includes/Wiki.php b/includes/Wiki.php index fbafba8139..9e8c720be0 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -444,7 +444,15 @@ class MediaWiki { public function run() { try { $this->checkMaxLag(); - $this->main(); + try { + $this->main(); + } catch ( ErrorPageError $e ) { + // Bug 62091: while exceptions are convenient to bubble up GUI errors, + // they are not internal application faults. As with normal requests, this + // should commit, print the output, do deferred updates, jobs, and profiling. + wfGetLBFactory()->commitMasterChanges(); + $e->report(); // display the GUI error + } if ( function_exists( 'fastcgi_finish_request' ) ) { fastcgi_finish_request(); }