From: Tim Starling Date: Sat, 20 Sep 2008 08:33:52 +0000 (+0000) Subject: * Always log connection errors X-Git-Tag: 1.31.0-rc.0~45199 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=e810660f91f391487caac2419eba271fe8200c54;p=lhc%2Fweb%2Fwiklou.git * Always log connection errors * Don't try to fetch the site notice, it will fail with the current code --- diff --git a/includes/db/Database.php b/includes/db/Database.php index ff7be62a41..ed5c05c1bc 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -367,6 +367,13 @@ class Database { } } $phpError = $this->restoreErrorHandler(); + if ( !$this->mConn ) { + $error = $this->lastError(); + if ( !$error ) { + $error = $phpError; + } + wfLogDBError( "Connection error: $error\n" ); + } wfProfileOut("dbconnect-$server"); @@ -464,7 +471,6 @@ class Database { } } else { # New method - wfLogDBError( "Connection error: $error\n" ); throw new DBConnectionError( $this, $error ); } } @@ -2500,7 +2506,6 @@ border=\"0\" ALT=\"Google\"> } $text = str_replace( '$1', $this->error, $noconnect ); - $text .= wfGetSiteNotice(); if($wgUseFileCache) { if($wgTitle) {