Sbisson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406051 )

Change subject: OptInController catch both errors and exception
......................................................................

OptInController catch both errors and exception

The problem that is currently causing the opt-out to
fail is not an Exception but an Error. Catching Throwable
to make sure we revert the transations in all cases.

Bug: T184670
Change-Id: Id0f4271d635094bf99f2fc8fa9cbbc4b08f07b46
---
M includes/Import/OptInController.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/51/406051/1

diff --git a/includes/Import/OptInController.php 
b/includes/Import/OptInController.php
index 49d9e84..5499036 100644
--- a/includes/Import/OptInController.php
+++ b/includes/Import/OptInController.php
@@ -124,18 +124,19 @@
                                                        } else {
                                                                $logger->error( 
$outerMethod . ': unrecognized action: ' . $action );
                                                        }
-                                               } catch ( Exception $e ) {
+                                               } catch ( \Throwable $t ) {
                                                        $logger->error(
-                                                               $outerMethod . 
' failed to {action} Flow on \'{talkpage}\' for user \'{user}\'.  Exception: 
{exception}',
+                                                               $outerMethod . 
' failed to {action} Flow on \'{talkpage}\' for user \'{user}\'. {message} 
{trace}',
                                                                [
                                                                        
'action' => $action,
                                                                        
'talkpage' => $talkpage,
                                                                        'user' 
=> $user,
-                                                                       
'exception' => $e,
+                                                                       
'message' => $t->getMessage(),
+                                                                       'trace' 
=> $t->getTraceAsString(),
                                                                ]
                                                        );
                                                        // rollback both Flow 
and Core DBs
-                                                       
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+                                                       
MWExceptionHandler::rollbackMasterChangesAndLog( $t );
                                                        
$this->dbFactory->getDB( DB_MASTER )->rollback( $outerMethod );
                                                }
                                        },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0f4271d635094bf99f2fc8fa9cbbc4b08f07b46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to