diff options
author | Sam Reed <reedy@users.mediawiki.org> | 2010-02-13 00:48:31 +0000 |
---|---|---|
committer | Sam Reed <reedy@users.mediawiki.org> | 2010-02-13 00:48:31 +0000 |
commit | 1f9a7d791c93f9581b46c5ab299a496cf8ba84a5 (patch) | |
tree | 0c8ce9ab5f7ed34b2172edbd48c6552a0b2d84eb | |
parent | 2081a0693fdad9f99e0cb17c94edf0cddbc353a6 (diff) | |
download | mediawikicore-1f9a7d791c93f9581b46c5ab299a496cf8ba84a5.tar.gz mediawikicore-1f9a7d791c93f9581b46c5ab299a496cf8ba84a5.zip |
Implement 9 modules dieUsage errors
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/62406
-rw-r--r-- | includes/api/ApiQuery.php | 6 | ||||
-rw-r--r-- | includes/api/ApiQueryAllimages.php | 7 | ||||
-rw-r--r-- | includes/api/ApiQueryAllpages.php | 7 | ||||
-rw-r--r-- | includes/api/ApiQueryCategories.php | 6 | ||||
-rw-r--r-- | includes/api/ApiQueryExtLinksUsage.php | 6 | ||||
-rw-r--r-- | includes/api/ApiQueryImageInfo.php | 6 | ||||
-rw-r--r-- | includes/api/ApiQueryLogEvents.php | 10 | ||||
-rw-r--r-- | includes/api/ApiQuerySiteinfo.php | 2 | ||||
-rw-r--r-- | includes/api/ApiQueryWatchlistRaw.php | 7 |
9 files changed, 54 insertions, 3 deletions
diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 75d0f89f2a7e..38f79aac515a 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -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 ( diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index c11304984860..363a65c36222 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -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 ( diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 42055b0e4258..a8573d828b67 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -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 ( diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index d45895df58e4..bf71ca62b88d 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -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 ( diff --git a/includes/api/ApiQueryExtLinksUsage.php b/includes/api/ApiQueryExtLinksUsage.php index 42614ad284bd..c4d43d5de194 100644 --- a/includes/api/ApiQueryExtLinksUsage.php +++ b/includes/api/ApiQueryExtLinksUsage.php @@ -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 ( diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 30da6b0628ed..e52d1410787c 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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() { diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index d6672b21d9db..fdc6f4add8e9 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -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 ( diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 0d35742921f2..1e42f4009f11 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -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' ), ) ); } diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index ab0957268b59..ff9b357c2a02 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -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 ( |