aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiPatrol.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiPatrol.php')
-rw-r--r--includes/api/ApiPatrol.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php
index 62528825ded0..c33542f1c7aa 100644
--- a/includes/api/ApiPatrol.php
+++ b/includes/api/ApiPatrol.php
@@ -40,19 +40,16 @@ class ApiPatrol extends ApiBase {
if ( isset( $params['rcid'] ) ) {
$rc = RecentChange::newFromId( $params['rcid'] );
if ( !$rc ) {
- $this->dieUsageMsg( [ 'nosuchrcid', $params['rcid'] ] );
+ $this->dieWithError( [ 'apierror-nosuchrcid', $params['rcid'] ] );
}
} else {
$rev = Revision::newFromId( $params['revid'] );
if ( !$rev ) {
- $this->dieUsageMsg( [ 'nosuchrevid', $params['revid'] ] );
+ $this->dieWithError( [ 'apierror-nosuchrevid', $params['revid'] ] );
}
$rc = $rev->getRecentChange();
if ( !$rc ) {
- $this->dieUsage(
- 'The revision ' . $params['revid'] . " can't be patrolled as it's too old",
- 'notpatrollable'
- );
+ $this->dieWithError( [ 'apierror-notpatrollable', $params['revid'] ] );
}
}
@@ -70,7 +67,7 @@ class ApiPatrol extends ApiBase {
$retval = $rc->doMarkPatrolled( $user, false, $tags );
if ( $retval ) {
- $this->dieUsageMsg( reset( $retval ) );
+ $this->dieStatus( $this->errorArrayToStatus( $retval, $user ) );
}
$result = [ 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) ];