r41062 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41061‎ | r41062 | r41063 >
Date:08:33, 20 September 2008
Author:tstarling
Status:old
Tags:
Comment:
* Always log connection errors
* Don't try to fetch the site notice, it will fail with the current code
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -367,6 +367,13 @@
368368 }
369369 }
370370 $phpError = $this->restoreErrorHandler();
 371+ if ( !$this->mConn ) {
 372+ $error = $this->lastError();
 373+ if ( !$error ) {
 374+ $error = $phpError;
 375+ }
 376+ wfLogDBError( "Connection error: $error\n" );
 377+ }
371378
372379 wfProfileOut("dbconnect-$server");
373380
@@ -464,7 +471,6 @@
465472 }
466473 } else {
467474 # New method
468 - wfLogDBError( "Connection error: $error\n" );
469475 throw new DBConnectionError( $this, $error );
470476 }
471477 }
@@ -2500,7 +2506,6 @@
25012507 }
25022508
25032509 $text = str_replace( '$1', $this->error, $noconnect );
2504 - $text .= wfGetSiteNotice();
25052510
25062511 if($wgUseFileCache) {
25072512 if($wgTitle) {