dieUsage getPossibleErrors in ApiQuerySearch and ApiQueryRevisions
authorSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:28:26 +0000 (01:28 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:28:26 +0000 (01:28 +0000)
includes/api/ApiQueryRevisions.php
includes/api/ApiQuerySearch.php

index 29be3ca..557d686 100644 (file)
@@ -564,6 +564,13 @@ class ApiQueryRevisions extends ApiQueryBase {
     public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'nosuchrevid', 'diffto' ),
+                       array( 'code' => 'revids', 'info' => 'The revids= parameter may not be used with the list options (limit, startid, endid, dirNewer, start, end).' ),
+                       array( 'code' => 'multpages', 'info' => 'titles, pageids or a generator was used to supply multiple pages, but the limit, startid, endid, dirNewer, user, excludeuser, start and end parameters may only be used on a single page.' ),
+                       array( 'code' => 'diffto', 'info' => 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"' ),
+                       array( 'code' => 'badparams', 'info' => 'start and startid cannot be used together' ),
+                       array( 'code' => 'badparams', 'info' => 'end and endid cannot be used together' ),
+                       array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ),
+                       array( 'code' => 'nosuchsection', 'info' => 'There is no section section in rID' ),
         ) );
        }
 
index 3cef480..cb7dc33 100644 (file)
@@ -216,6 +216,14 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'Perform a full text search';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'param-search', 'info' => 'empty search string is not allowed' ),
+                       array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ),
+                       array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (