summaryrefslogtreecommitdiff
path: root/includes/db/DatabaseError.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/db/DatabaseError.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/db/DatabaseError.php')
-rw-r--r--includes/db/DatabaseError.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/includes/db/DatabaseError.php b/includes/db/DatabaseError.php
index 86950a89..928de616 100644
--- a/includes/db/DatabaseError.php
+++ b/includes/db/DatabaseError.php
@@ -329,12 +329,19 @@ class DBQueryError extends DBExpectedError {
* @param string $fname
*/
function __construct( DatabaseBase $db, $error, $errno, $sql, $fname ) {
- $message = "A database error has occurred. Did you forget to run " .
- "maintenance/update.php after upgrading? See: " .
- "https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
- "Query: $sql\n" .
- "Function: $fname\n" .
- "Error: $errno $error\n";
+ if ( $db->wasConnectionError( $errno ) ) {
+ $message = "A connection error occured. \n" .
+ "Query: $sql\n" .
+ "Function: $fname\n" .
+ "Error: $errno $error\n";
+ } else {
+ $message = "A database error has occurred. Did you forget to run " .
+ "maintenance/update.php after upgrading? See: " .
+ "https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
+ "Query: $sql\n" .
+ "Function: $fname\n" .
+ "Error: $errno $error\n";
+ }
parent::__construct( $db, $message );
$this->error = $error;