Complete dieUsage errors in 7 more Api files
authorSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:21:52 +0000 (01:21 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 01:21:52 +0000 (01:21 +0000)
includes/api/ApiPageSet.php
includes/api/ApiQueryCategoryMembers.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php
includes/api/ApiUpload.php

index e6dd7f2..ac1682e 100644 (file)
@@ -691,6 +691,13 @@ class ApiPageSet extends ApiQueryBase {
                );
        }
 
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'multisource', 'info' => "Cannot use 'pageids' at the same time as 'dataSource'" ),
+                       array( 'code' => 'multisource', 'info' => "Cannot use 'revids' at the same time as 'dataSource'" ),
+               ) );
+       }
+
        public function getVersion() {
                return __CLASS__ . ': $Id$';
        }
index 0c2ba7f..40970f4 100644 (file)
@@ -275,6 +275,14 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'List all pages in a given category';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'notitle', 'info' => 'The cmtitle parameter is required' ),
+                       array( 'code' => 'invalidcategory', 'info' => 'The category name you entered is not valid' ),
+                       array( 'code' => 'badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index caa4f3a..0dd0dcd 100644 (file)
@@ -314,6 +314,15 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                                'For instance, a parameter marked (1) only applies to mode 1 and is ignored in modes 2 and 3.',
                );
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revision information' ),
+                       array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ),
+                       array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revision content' ),
+                       array( 'code' => 'badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 0d284d6..5f12e2e 100644 (file)
@@ -526,6 +526,14 @@ class ApiQueryRecentChanges extends ApiQueryBase {
        public function getDescription() {
                return 'Enumerate recent changes';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
+                       array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 79ceb86..eeb3c59 100644 (file)
@@ -417,6 +417,15 @@ class ApiQueryContributions extends ApiQueryBase {
        public function getDescription() {
                return 'Get all edits by a user';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'param_user', 'info' => 'User parameter may not be empty.' ),
+                       array( 'code' => 'param_user', 'info' => 'User name user is not valid' ),
+                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 8a0e8fb..4147605 100644 (file)
@@ -372,6 +372,18 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
        public function getDescription() {
                return "Get all recent changes to pages in the logged in user's watchlist";
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'bad_wlowner', 'info' => 'Specified user does not exist' ),
+                       array( 'code' => 'bad_wltoken', 'info' => 'Incorrect watchlist token provided -- please set a correct token in Special:Preferences' ),
+                       array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
+                       array( 'code' => 'patrol', 'info' => 'patrol property is not available' ),
+                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+                       array( 'code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag' ),
+                       array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 2d8f739..72146e6 100644 (file)
@@ -339,6 +339,14 @@ class ApiUpload extends ApiBase {
                        array( 'mustbeloggedin', 'upload' ),
                        array( 'badaccess-groups' ),
                        array( 'badaccess-groups' ),
+                       array( 'code' => 'fetchfileerror', 'info' => '' ),
+                       array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
+                       array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),
+                       array( 'code' => 'filetype-missing', 'info' => 'The file is missing an extension' ),
+                       array( 'code' => 'filename-tooshort', 'info' => 'The filename is too short' ),
+                       array( 'code' => 'overwrite', 'info' => 'Overwriting an existing file is not allowed' ),
+                       array( 'code' => 'stashfailed', 'info' => 'Stashing temporary file failed' ),
+                       array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ),
         ) );
        }