Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -482,6 +482,12 @@ |
483 | 483 | return 'Return general information about the site.'; |
484 | 484 | } |
485 | 485 | |
| 486 | + public function getPossibleErrors() { |
| 487 | + return array_merge( parent::getPossibleErrors(), array( |
| 488 | + array( 'code' => 'includeAllDenied', 'info' => 'Cannot view all servers info unless $wgShowHostnames is true', ), |
| 489 | + ) ); |
| 490 | + } |
| 491 | + |
486 | 492 | protected function getExamples() { |
487 | 493 | return array( |
488 | 494 | 'api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics', |
Index: trunk/phase3/includes/api/ApiPurge.php |
— | — | @@ -102,6 +102,13 @@ |
103 | 103 | 'Purge the cache for the given titles.' |
104 | 104 | ); |
105 | 105 | } |
| 106 | + |
| 107 | + public function getPossibleErrors() { |
| 108 | + return array_merge( parent::getPossibleErrors(), array( |
| 109 | + array( 'cantpurge' ), |
| 110 | + array( 'missingparam', 'titles' ), |
| 111 | + ) ); |
| 112 | + } |
106 | 113 | |
107 | 114 | protected function getExamples() { |
108 | 115 | return array( |
Index: trunk/phase3/includes/api/ApiUserrights.php |
— | — | @@ -105,6 +105,14 @@ |
106 | 106 | 'Add/remove a user to/from groups', |
107 | 107 | ); |
108 | 108 | } |
| 109 | + |
| 110 | + public function getPossibleErrors() { |
| 111 | + return array_merge( parent::getPossibleErrors(), array( |
| 112 | + array( 'missingparam', 'user' ), |
| 113 | + array( 'missingparam', 'token' ), |
| 114 | + array( 'sessionfailure' ), |
| 115 | + ) ); |
| 116 | + } |
109 | 117 | |
110 | 118 | protected function getExamples() { |
111 | 119 | return array ( |
Index: trunk/phase3/includes/api/ApiUnblock.php |
— | — | @@ -108,6 +108,16 @@ |
109 | 109 | 'Unblock a user.' |
110 | 110 | ); |
111 | 111 | } |
| 112 | + |
| 113 | + public function getPossibleErrors() { |
| 114 | + return array_merge( parent::getPossibleErrors(), array( |
| 115 | + array( 'unblock-notarget' ), |
| 116 | + array( 'unblock-idanduser' ), |
| 117 | + array( 'missingparam', 'token' ), |
| 118 | + array( 'sessionfailure' ), |
| 119 | + array( 'cantunblock' ), |
| 120 | + ) ); |
| 121 | + } |
112 | 122 | |
113 | 123 | protected function getExamples() { |
114 | 124 | return array ( |
Index: trunk/phase3/includes/api/ApiLogin.php |
— | — | @@ -167,6 +167,21 @@ |
168 | 168 | 'This is to prevent password guessing by automated password crackers.' |
169 | 169 | ); |
170 | 170 | } |
| 171 | + |
| 172 | + public function getPossibleErrors() { |
| 173 | + return array_merge( parent::getPossibleErrors(), array ( |
| 174 | + array( 'code' => 'NoName', 'info' => 'You didn\'t set the lgname parameter' ), |
| 175 | + array( 'code' => 'Illegal', 'info' => ' You provided an illegal username' ), |
| 176 | + array( 'code' => 'NotExists', 'info' => ' The username you provided doesn\'t exist' ), |
| 177 | + array( 'code' => 'EmptyPass', 'info' => ' You didn\'t set the lgpassword parameter or you left it empty' ), |
| 178 | + array( 'code' => 'WrongPass', 'info' => ' The password you provided is incorrect' ), |
| 179 | + array( 'code' => 'WrongPluginPass', 'info' => 'Same as `WrongPass", returned when an authentication plugin rather than MediaWiki itself rejected the password' ), |
| 180 | + array( 'code' => 'CreateBlocked', 'info' => 'The wiki tried to automatically create a new account for you, but your IP address has been blocked from account creation' ), |
| 181 | + array( 'code' => 'Throttled', 'info' => 'You\'ve logged in too many times in a short time' ), |
| 182 | + array( 'code' => 'Blocked', 'info' => 'User is blocked' ), |
| 183 | + ) ); |
| 184 | +; |
| 185 | + } |
171 | 186 | |
172 | 187 | protected function getExamples() { |
173 | 188 | return array( |
Index: trunk/phase3/includes/api/ApiFormatXml.php |
— | — | @@ -190,7 +190,6 @@ |
191 | 191 | ); |
192 | 192 | } |
193 | 193 | |
194 | | - |
195 | 194 | public function getDescription() { |
196 | 195 | return 'Output data in XML format' . parent :: getDescription(); |
197 | 196 | } |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -539,6 +539,12 @@ |
540 | 540 | '', |
541 | 541 | ); |
542 | 542 | } |
| 543 | + |
| 544 | + public function getPossibleErrors() { |
| 545 | + return array_merge( parent::getPossibleErrors(), array( |
| 546 | + array( 'readonlytext' ), |
| 547 | + ) ); |
| 548 | + } |
543 | 549 | |
544 | 550 | /** |
545 | 551 | * Returns an array of strings with credits for the API |
Index: trunk/phase3/includes/api/ApiEmailUser.php |
— | — | @@ -103,6 +103,15 @@ |
104 | 104 | 'Email a user.' |
105 | 105 | ); |
106 | 106 | } |
| 107 | + |
| 108 | + public function getPossibleErrors() { |
| 109 | + return array_merge( parent::getPossibleErrors(), array( |
| 110 | + array( 'usermaildisabled' ), |
| 111 | + array( 'missingparam', 'target' ), |
| 112 | + array( 'missingparam', 'text' ), |
| 113 | + array( 'missingparam', 'token' ), |
| 114 | + ) ); |
| 115 | + } |
107 | 116 | |
108 | 117 | protected function getExamples() { |
109 | 118 | return array ( |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -326,6 +326,21 @@ |
327 | 327 | 'log out and then log back in). Also you must get and send an edit token before doing any upload stuff.' |
328 | 328 | ); |
329 | 329 | } |
| 330 | + |
| 331 | + public function getPossibleErrors() { |
| 332 | + return array_merge( parent::getPossibleErrors(), array( |
| 333 | + array( 'uploaddisabled' ), |
| 334 | + array( 'missingparam', 'token' ), |
| 335 | + array( 'sessionfailure' ), |
| 336 | + array( 'invalid-session-key' ), |
| 337 | + array( 'uploaddisabled' ), |
| 338 | + array( 'badaccess-groups' ), |
| 339 | + array( 'missingparam', 'filename' ), |
| 340 | + array( 'mustbeloggedin', 'upload' ), |
| 341 | + array( 'badaccess-groups' ), |
| 342 | + array( 'badaccess-groups' ), |
| 343 | + ) ); |
| 344 | + } |
330 | 345 | |
331 | 346 | protected function getExamples() { |
332 | 347 | return array( |