jenkins-bot has submitted this change and it was merged.

Change subject: Add verbose debug logging for bug 39996
......................................................................


Add verbose debug logging for bug 39996

Change-Id: I1492f45c9168c4d080d27dde61997edace36dd6e
(cherry picked from commit 4ac079bb53f94192187b2586ffce05acaecaa674)
---
M CentralAuthHooks.php
M CentralAuthPlugin.php
2 files changed, 13 insertions(+), 3 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 4110161..d4b29af 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -943,12 +943,19 @@
                }
 
                // Checks passed, create the user
-               wfDebug( __METHOD__ . ": creating new user\n" );
-               $status = $user->addToDatabase();
+               wfDebugLog( 'CentralAuth-Bug39996', __METHOD__ . ": creating 
new user ($userName)\n" );
+               try {
+                       $status = $user->addToDatabase();
+               } catch ( MWException $e ) {
+                       wfDebugLog( 'CentralAuth-Bug39996', __METHOD__ . 
"User::addToDatabase for \"$userName\" threw an exception:"
+                               . " {$e->getMessage()}" );
+                       throw $e;
+               }
+
                if ( $status === null ) {
                        // MW before 1.21 -- ok, continue
                } elseif ( !$status->isOK() ) {
-                       wfDebug( __METHOD__.": failed with message " . 
$status->getWikiText() . "\n" );
+                       wfDebugLog( 'CentralAuth-Bug39996', __METHOD__.": 
failed with message " . $status->getWikiText() . "\n" );
                        return false;
                }
 
diff --git a/CentralAuthPlugin.php b/CentralAuthPlugin.php
index 1d21a57..1cd84c6 100644
--- a/CentralAuthPlugin.php
+++ b/CentralAuthPlugin.php
@@ -241,6 +241,9 @@
                                $this->updateUser( $user );
                                // Log the autocreation just happened
                                $user->addNewUserLogEntryAutoCreate();
+                       } else {
+                               wfDebugLog( 'CentralAuth-Bug39996', __METHOD__ 
. ": CentralAuthUser::exists returned false for "
+                                       . "\"{$user->getName()}\" even though 
\$autocreate = true." );
                        }
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/146150
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1492f45c9168c4d080d27dde61997edace36dd6e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: wmf/1.24wmf12
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to