From da31137022583a41763993332955f065ec0d85ce Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 23 Jul 2009 23:50:04 +0000 Subject: [PATCH] Better documentation for dieUsage() If I got it wrong, please improve. --- includes/api/ApiBase.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 9879aedd5b..eb77af4b53 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -721,10 +721,15 @@ abstract class ApiBase { } /** - * Call the main module's error handler - * @param $description string Error text - * @param $errorCode string Error code + * Throw a UsageException, which will (if uncaught) call the main module's + * error handler and die with an error message. + * + * @param $description string One-line human-readable description of the + * error condition, e.g., "The API requires a valid action parameter" + * @param $errorCode string Brief, arbitrary, stable string to allow easy + * automated identification of the error, e.g., 'unknown_action' * @param $httpRespCode int HTTP response code + * @param $extradata fixme: document this */ public function dieUsage($description, $errorCode, $httpRespCode = 0, $extradata = null) { wfProfileClose(); -- 2.20.1