r62409 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62408‎ | r62409 | r62410 >
Date:01:05, 13 February 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Complete dieUsage errors in 6 more Api files
Modified paths:
  • /trunk/phase3/includes/api/ApiEditPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBlocks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllLinks.php
@@ -188,6 +188,15 @@
189189 public function getDescription() {
190190 return 'Enumerate all links that point to a given namespace';
191191 }
 192+
 193+ public function getPossibleErrors() {
 194+ return array_merge( parent::getPossibleErrors(), array(
 195+ array( 'code' => 'params', 'info' => $this->getModuleName() . ' cannot be used as a generator in unique links mode' ),
 196+ array( 'code' => 'params', 'info' => $this->getModuleName() . ' cannot return corresponding page ids in unique links mode' ),
 197+ array( 'code' => 'params', 'info' => 'alcontinue and alfrom cannot be used together' ),
 198+ array( 'code' => 'badcontinue', 'info' => 'Invalid continue parameter' ),
 199+ ) );
 200+ }
192201
193202 protected function getExamples() {
194203 return array (
Index: trunk/phase3/includes/api/ApiParse.php
@@ -306,6 +306,15 @@
307307 public function getDescription() {
308308 return 'This module parses wikitext and returns parser output';
309309 }
 310+
 311+ public function getPossibleErrors() {
 312+ return array_merge( parent::getPossibleErrors(), array(
 313+ array( 'code' => 'params', 'info' => 'The page parameter cannot be used together with the text and title parameters' ),
 314+ array( 'code' => 'missingrev', 'info' => 'There is no revision ID oldid' ),
 315+ array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revisions' ),
 316+ array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ),
 317+ ) );
 318+ }
310319
311320 protected function getExamples() {
312321 return array (
Index: trunk/phase3/includes/api/ApiQueryBacklinks.php
@@ -458,6 +458,8 @@
459459 return array_merge( parent::getPossibleErrors(), array(
460460 array( 'invalidtitle', 'title' ),
461461 array( 'missingparam', 'title' ),
 462+ array( 'code' => 'bad_image_title', 'info' => "The title for {$this->getModuleName()} query must be an image" ),
 463+ array( 'code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
462464 ) );
463465 }
464466
Index: trunk/phase3/includes/api/ApiQueryBlocks.php
@@ -257,6 +257,15 @@
258258 public function getDescription() {
259259 return 'List all blocked users and IP addresses.';
260260 }
 261+
 262+ public function getPossibleErrors() {
 263+ return array_merge( parent::getPossibleErrors(), array(
 264+ array( 'code' => 'usersandip', 'info' => 'bkusers and bkip cannot be used together' ),
 265+ array( 'code' => 'cidrtoobroad', 'info' => 'CIDR ranges broader than /16 are not accepted' ),
 266+ array( 'code' => 'param_user', 'info' => 'User parameter may not be empty' ),
 267+ array( 'code' => 'param_user', 'info' => 'User name user is not valid' ),
 268+ ) );
 269+ }
261270
262271 protected function getExamples() {
263272 return array ( 'api.php?action=query&list=blocks',
Index: trunk/phase3/includes/api/ApiEditPage.php
@@ -378,6 +378,8 @@
379379 array( 'editconflict' ),
380380 array( 'emptynewsection' ),
381381 array( 'unknownerror', 'retval' ),
 382+ array( 'code' => 'nosuchsection', 'info' => '' ), "There is no section section.", ''
 383+ array( 'code' => 'invalidsection', 'info' => 'The section parameter must be set to an integer or \'new\'' ),
382384 ) );
383385 }
384386
Index: trunk/phase3/includes/api/ApiMain.php
@@ -543,6 +543,10 @@
544544 public function getPossibleErrors() {
545545 return array_merge( parent::getPossibleErrors(), array(
546546 array( 'readonlytext' ),
 547+ array( 'code' => 'unknown_format', 'info' => 'Unrecognized format: format' ),
 548+ array( 'code' => 'unknown_action', 'info' => 'The API requires a valid action parameter' ),
 549+ array( 'code' => 'maxlag', 'info' => 'Waiting for host: x seconds lagged' ),
 550+ array( 'code' => 'maxlag', 'info' => 'Waiting for a database server: x seconds lagged' ),
547551 ) );
548552 }
549553

Comments

#Comment by Catrope (talk | contribs)   13:52, 14 February 2010
+			array( 'code' => 'nosuchsection', 'info' => '' ), "There is no section section.", ''

This was fixed in r62411.

Status & tagging log