jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/332010 )
Change subject: MassMessageJob: Log correctly when catching ApiUsageExceptions
......................................................................
MassMessageJob: Log correctly when catching ApiUsageExceptions
Just log one error from the Status to match the behavior of the old
code.
Bug: T155274
Change-Id: I02131821f39ec2ad649d202264655af28067e62f
---
M includes/job/MassMessageJob.php
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/job/MassMessageJob.php b/includes/job/MassMessageJob.php
index 59e4fd7..3460891 100644
--- a/includes/job/MassMessageJob.php
+++ b/includes/job/MassMessageJob.php
@@ -319,10 +319,13 @@
}
}
// If the failure is not caused by an edit
conflict or if there
- // have been too many failures, log the error
and continue
+ // have been too many failures, log the (first)
error and continue
// execution. Otherwise retry the request.
if ( !$isEditConflict || $attemptCount >= 5 ) {
- $this->logLocalFailure( $errorCode );
+ foreach (
$e->getStatusValue()->getErrors() as $error ) {
+ $this->logLocalFailure(
ApiMessage::create( $error )->getApiCode() );
+ break;
+ }
break;
}
} catch ( UsageException $e ) {
--
To view, visit https://gerrit.wikimedia.org/r/332010
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I02131821f39ec2ad649d202264655af28067e62f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Wctaiwan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits