From 69113589779e541cd9061abf7796935aef5264ba Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 13 Feb 2010 01:05:14 +0000 Subject: [PATCH] Complete dieUsage errors in 6 more Api files --- includes/api/ApiEditPage.php | 2 ++ includes/api/ApiMain.php | 4 ++++ includes/api/ApiParse.php | 9 +++++++++ includes/api/ApiQueryAllLinks.php | 9 +++++++++ includes/api/ApiQueryBacklinks.php | 2 ++ includes/api/ApiQueryBlocks.php | 9 +++++++++ 6 files changed, 35 insertions(+) diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 9a9b597f5f..ae94c3fe33 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -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\'' ), ) ); } diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 2a48f7786a..da986323bd 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -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' ), ) ); } diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index f731047efe..3380b1ae05 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -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 ( diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 706ed0c4e4..04ec7ffbaa 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -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 ( diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 2a76544741..3b8d2a254f 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -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' ), ) ); } diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index c43143eea6..c41db20746 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -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', -- 2.20.1