Merge "Log when User::saveSettings is called in read-only mode"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Apr 2015 09:44:59 +0000 (09:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Apr 2015 09:44:59 +0000 (09:44 +0000)
includes/User.php

index 6ac320e..ecb31ba 100644 (file)
@@ -3592,7 +3592,13 @@ class User implements IDBAccessObject {
                global $wgAuth;
 
                if ( wfReadOnly() ) {
-                       return; // @TODO: caller should deal with this instead!
+                       // @TODO: caller should deal with this instead!
+                       // This should really just be an exception.
+                       MWExceptionHandler::logException( new DBExpectedError(
+                               null,
+                               "Could not update user with ID '{$this->mId}'; DB is read-only."
+                       ) );
+                       return;
                }
 
                $this->load();