summaryrefslogtreecommitdiff
path: root/includes/db/DatabaseError.php
diff options
context:
space:
mode:
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;