From: pdontthink Date: Fri, 11 Jul 2008 23:43:39 +0000 (+0000) Subject: Update error codes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a49f857e6e78488abd83d458b59dd49d4d3b7786;p=squirrelmail.git Update error codes git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13233 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/squirrelmail_rpc.php b/src/squirrelmail_rpc.php index b262f305..92308e75 100644 --- a/src/squirrelmail_rpc.php +++ b/src/squirrelmail_rpc.php @@ -6,7 +6,7 @@ * This file contains the entry point to the "SquirrelMail API" -- the * remote procedure call request receiver. * - * @copyright © 1999-2007 The SquirrelMail Project Team + * @copyright © 1999-2008 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -55,13 +55,31 @@ require('../include/init.php'); +//FIXME: do we need to put this list somewhere else? +//FIXME: do we want to use constants instead? probably not a bad idea, although plugins probably won't, so we still want to try to keep track of the plugin error codes too if possible (new plugin website should help) +/** + * Known core error codes: + * + * 1 - No RPC action was given in request (please use "rpc_action") + * 2 - RPC action was not understood (perhaps a needed plugin is + * not installed and activated?) + * + * Known plugin error codes: + * + * 500 - Empty Folders plugin efPurgeTrash action failed + * 501 - Empty Folders plugin efPurgeAll action failed + * 502 - Empty Folders plugin efDeleteAll action failed + * + */ + + + /** * Get RPC Action (can be in either GET or POST) * */ if (!sqGetGlobalVar('rpc_action', $rpc_action, SQ_FORM)) { -//FIXME: establish error codes (using 99 in the interim) - sm_rpc_return_error(99, _("No RPC action given")); + sm_rpc_return_error(1, _("No RPC action given")); } @@ -96,6 +114,9 @@ $oTemplate->header('Cache-Control: no-cache'); * in an array in case we can think of more parameters * to add in the future. * + * Known users of this hook: + * empty_folders + * */ $temp = array(&$rpc_action); $handled_by_plugin = boolean_hook_function('squirrelmail_rpc', $temp, 1); @@ -157,7 +178,7 @@ if (!$handled_by_plugin) switch (strtolower($rpc_action)) { * */ default: - sm_rpc_return_error(99, _("RPC action not understood")); + sm_rpc_return_error(2, _("RPC action not understood")); break; }