From e810660f91f391487caac2419eba271fe8200c54 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 20 Sep 2008 08:33:52 +0000 Subject: [PATCH] * Always log connection errors * Don't try to fetch the site notice, it will fail with the current code --- includes/db/Database.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) { -- 2.20.1