Implement 9 modules dieUsage errors
authorSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 00:48:31 +0000 (00:48 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 13 Feb 2010 00:48:31 +0000 (00:48 +0000)
includes/api/ApiQuery.php
includes/api/ApiQueryAllimages.php
includes/api/ApiQueryAllpages.php
includes/api/ApiQueryCategories.php
includes/api/ApiQueryExtLinksUsage.php
includes/api/ApiQueryImageInfo.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQuerySiteinfo.php
includes/api/ApiQueryWatchlistRaw.php

index 75d0f89..38f79aa 100644 (file)
@@ -561,6 +561,12 @@ class ApiQuery extends ApiBase {
                        'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites.'
                );
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index c113049..363a65c 100644 (file)
@@ -192,6 +192,13 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'Enumerate all images sequentially';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator' ),
+                       array( 'code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 42055b0..a8573d8 100644 (file)
@@ -260,6 +260,13 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'Enumerate all pages sequentially in a given namespace';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'params', 'info' => 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator' ),
+                       array( 'code' => 'params', 'info' => 'prlevel may not be used without prtype' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index d45895d..bf71ca6 100644 (file)
@@ -217,6 +217,12 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'List all categories the page(s) belong to';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 42614ad..c4d43d5 100644 (file)
@@ -202,6 +202,12 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
        public function getDescription() {
                return 'Enumerate pages that contain a given URL';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'bad_query', 'info' => 'Invalid query' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 30da6b0..e52d141 100644 (file)
@@ -318,6 +318,12 @@ class ApiQueryImageInfo extends ApiQueryBase {
                return array (
                        'Returns image information and upload history'
                );
+       }       
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'iiurlwidth', 'info' => 'iiurlheight cannot be used without iiurlwidth' ),
+               ) );
        }
 
        protected function getExamples() {
index d6672b2..fdc6f4a 100644 (file)
@@ -284,8 +284,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                
                return $vals;
        }
-
-
+       
        public function getAllowedParams() {
                global $wgLogTypes;
                return array (
@@ -350,6 +349,13 @@ class ApiQueryLogEvents extends ApiQueryBase {
        public function getDescription() {
                return 'Get events from logs.';
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'param_user', 'info' => 'User name $user not found' ),
+                       array( 'code' => 'param_title', 'info' => 'Bad title value \'title\'' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (
index 0d35742..1e42f40 100644 (file)
@@ -484,7 +484,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true' ),
+                       array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true' ),
                ) );
        }
 
index ab09572..ff9b357 100644 (file)
@@ -170,6 +170,13 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
        public function getDescription() {
                return "Get all pages on the logged in user's watchlist";
        }
+       
+       public function getPossibleErrors() {
+               return array_merge( parent::getPossibleErrors(), array(
+                       array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
+                       array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+               ) );
+       }
 
        protected function getExamples() {
                return array (