* This is a simple JSON-RPC server.
*/
+
/* Bring in the json format/parse functions */
jsonrpc_include("json.esp");
jsonrpc.Constant.ErrorCode = new Object(); /* server-generated error codes */
jsonrpc.method = new Object(); /* methods available in requested class */
-
/*
* ScriptTransport constants
*/
*/
jsonrpc.Constant.ErrorCode.MethodNotFound = 4;
-/**
+/*
* Error code, value 5: Parameter Mismatch
*
* If a method discovers that the parameters (arguments) provided to it do not
* match the requisite types for the method's parameters, it should return
* this error code to indicate so to the caller.
+ *
+ * This error is also used to indicate an illegal parameter value, in server
+ * scripts.
*/
jsonrpc.Constant.ErrorCode.PaameterMismatch = 5;
*/
jsonrpc.Constant.ErrorCode.UnexpectedOutput = 7;
-
+/*
+ * Error code, value 8: Resource Error
+ *
+ * Too many resources were requested, a system limitation on the total number
+ * of resources has been reached, or a resource or resource id was misused.
+ */
+jsonrpc.Constant.ErrorCode.ResourceError = 8;
}
/* Ensure the logged-in user is allowed to issue the requested method */
-if (! json_authenticate(serviceComponents, method))
+if (! json_authenticate(serviceComponents, jsonInput.method))
{
error.setError(jsonrpc.Constant.ErrorCode.PermissionDenied,
"Permission denied");