diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/db/DatabaseError.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/db/DatabaseError.php')
-rw-r--r-- | includes/db/DatabaseError.php | 19 |
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; |