Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -295,6 +295,8 @@ |
296 | 296 | * |
297 | 297 | * Cache control values set here will only be used if the cache mode is not |
298 | 298 | * private, see setCacheMode(). |
| 299 | + * |
| 300 | + * @param $directives array |
299 | 301 | */ |
300 | 302 | public function setCacheControl( $directives ) { |
301 | 303 | $this->mCacheControl = $directives + $this->mCacheControl; |
— | — | @@ -359,11 +361,9 @@ |
360 | 362 | wfDebugLog( 'exception', $e->getLogMessage() ); |
361 | 363 | } |
362 | 364 | |
363 | | - // |
364 | 365 | // Handle any kind of exception by outputing properly formatted error message. |
365 | 366 | // If this fails, an unhandled exception should be thrown so that global error |
366 | 367 | // handler will process and log it. |
367 | | - // |
368 | 368 | |
369 | 369 | $errCode = $this->substituteResultWithError( $e ); |
370 | 370 | |
— | — | @@ -601,7 +601,6 @@ |
602 | 602 | return true; |
603 | 603 | } |
604 | 604 | |
605 | | - |
606 | 605 | /** |
607 | 606 | * Check for sufficient permissions to execute |
608 | 607 | * @param $module ApiBase An Api module |
— | — | @@ -786,9 +785,16 @@ |
787 | 786 | '**********************************************************************************************************', |
788 | 787 | '', |
789 | 788 | 'Status: All features shown on this page should be working, but the API', |
790 | | - ' is still in active development, and may change at any time.', |
| 789 | + ' is still in active development, and may change at any time.', |
791 | 790 | ' Make sure to monitor our mailing list for any updates', |
792 | 791 | '', |
| 792 | + 'Erroneous requests: When erroneous are sent to the API, a HTTP header will be sent', |
| 793 | + ' with the key "MediaWiki-API-Error" and then both the value of the', |
| 794 | + ' header and the error code sent back will be set to the same value', |
| 795 | + '', |
| 796 | + ' In the case of an invalid action being passed, these will have a value', |
| 797 | + ' of "unknown_action"', |
| 798 | + '', |
793 | 799 | 'Documentation: http://www.mediawiki.org/wiki/API', |
794 | 800 | 'Mailing list: http://lists.wikimedia.org/mailman/listinfo/mediawiki-api', |
795 | 801 | 'Api Announcements: http://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce', |
— | — | @@ -1023,10 +1029,16 @@ |
1024 | 1030 | $this->mExtraData = $extradata; |
1025 | 1031 | } |
1026 | 1032 | |
| 1033 | + /** |
| 1034 | + * @return string |
| 1035 | + */ |
1027 | 1036 | public function getCodeString() { |
1028 | 1037 | return $this->mCodestr; |
1029 | 1038 | } |
1030 | 1039 | |
| 1040 | + /** |
| 1041 | + * @return array |
| 1042 | + */ |
1031 | 1043 | public function getMessageArray() { |
1032 | 1044 | $result = array( |
1033 | 1045 | 'code' => $this->mCodestr, |
— | — | @@ -1038,6 +1050,9 @@ |
1039 | 1051 | return $result; |
1040 | 1052 | } |
1041 | 1053 | |
| 1054 | + /** |
| 1055 | + * @return string |
| 1056 | + */ |
1042 | 1057 | public function __toString() { |
1043 | 1058 | return "{$this->getCodeString()}: {$this->getMessage()}"; |
1044 | 1059 | } |