Complete dieUsage errors in 6 more Api files
authorSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:05:14 +0000 (01:05 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:05:14 +0000 (01:05 +0000)
includes/api/ApiEditPage.php
includes/api/ApiMain.php
includes/api/ApiParse.php
includes/api/ApiQueryAllLinks.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryBlocks.php

index 9a9b597..ae94c3f 100644 (file)
@@ -378,6 +378,8 @@ class ApiEditPage extends ApiBase {
                        array( 'editconflict' ),
                        array( 'emptynewsection' ),
                        array( 'unknownerror', 'retval' ),
+                       array( 'code' => 'nosuchsection', 'info' => '' ), "There is no section section.", ''
+                       array( 'code' => 'invalidsection', 'info' => 'The section parameter must be set to an integer or \'new\'' ),
         ) );
        }
 
index 2a48f77..da98632 100644 (file)
@@ -543,6 +543,10 @@ class ApiMain extends ApiBase {
     public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'readonlytext' ),
+                       array( 'code' => 'unknown_format', 'info' => 'Unrecognized format: format' ),
+                       array( 'code' => 'unknown_action', 'info' => 'The API requires a valid action parameter' ),
+                       array( 'code' => 'maxlag', 'info' => 'Waiting for host: x seconds lagged' ),
+                       array( 'code' => 'maxlag', 'info' => 'Waiting for a database server: x seconds lagged' ),
         ) );
        }
 
index f731047..3380b1a 100644 (file)
@@ -306,6 +306,15 @@ class ApiParse extends ApiBase {
        public function getDescription() {
                return 'This module parses wikitext and returns parser output';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'params', 'info' => 'The page parameter cannot be used together with the text and title parameters' ),
+                       array( 'code' => 'missingrev', 'info' => 'There is no revision ID oldid' ),
+                       array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revisions' ),
+                       array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 706ed0c..04ec7ff 100644 (file)
@@ -188,6 +188,15 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'Enumerate all links that point to a given namespace';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'params', 'info' => $this->getModuleName() . ' cannot be used as a generator in unique links mode' ),
+                       array( 'code' => 'params', 'info' => $this->getModuleName() . ' cannot return corresponding page ids in unique links mode' ),
+                       array( 'code' => 'params', 'info' => 'alcontinue and alfrom cannot be used together' ),
+                       array( 'code' => 'badcontinue', 'info' => 'Invalid continue parameter' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 2a76544..3b8d2a2 100644 (file)
@@ -458,6 +458,8 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'invalidtitle', 'title' ),
                        array( 'missingparam', 'title' ),
+                       array( 'code' => 'bad_image_title', 'info' => "The title for {$this->getModuleName()} query must be an image" ),
+                       array( 'code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
         ) );
        }
 
index c43143e..c41db20 100644 (file)
@@ -257,6 +257,15 @@ class ApiQueryBlocks extends ApiQueryBase {
        public function getDescription() {
                return 'List all blocked users and IP addresses.';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'usersandip', 'info' => 'bkusers and bkip cannot be used together' ),
+                       array( 'code' => 'cidrtoobroad', 'info' => 'CIDR ranges broader than /16 are not accepted' ),
+                       array( 'code' => 'param_user', 'info' => 'User parameter may not be empty' ),
+                       array( 'code' => 'param_user', 'info' => 'User name user is not valid' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (  'api.php?action=query&list=blocks',