From d299fc6a55ffd5db3b27359bca10237743edb5b1 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 13 Feb 2010 01:21:52 +0000 Subject: [PATCH] Complete dieUsage errors in 7 more Api files --- includes/api/ApiPageSet.php | 7 +++++++ includes/api/ApiQueryCategoryMembers.php | 8 ++++++++ includes/api/ApiQueryDeletedrevs.php | 9 +++++++++ includes/api/ApiQueryRecentChanges.php | 8 ++++++++ includes/api/ApiQueryUserContributions.php | 9 +++++++++ includes/api/ApiQueryWatchlist.php | 12 ++++++++++++ includes/api/ApiUpload.php | 8 ++++++++ 7 files changed, 61 insertions(+) diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index e6dd7f2e94..ac1682ecc0 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -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$'; } diff --git a/includes/api/ApiQueryCategoryMembers.php b/includes/api/ApiQueryCategoryMembers.php index 0c2ba7f258..40970f4945 100644 --- a/includes/api/ApiQueryCategoryMembers.php +++ b/includes/api/ApiQueryCategoryMembers.php @@ -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 ( diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index caa4f3aa83..0dd0dcdffa 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -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 ( diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 0d284d6bbb..5f12e2eaf7 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -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 ( diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 79ceb86189..eeb3c59525 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -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 ( diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 8a0e8fb1a3..4147605324 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -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 ( diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 2d8f739527..72146e68b0 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -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' ), ) ); } -- 2.20.1