I am developing an android app which connects a python server through JSON. I am now encountering a bug that hinders the connection between the android client and python server.
Since pyjsonrpc never include the key "error" in its response JSON string, android-json-rpc package throws an exception about finding no "error" key in the response.
The exception is thrown in the file JSONRPCHttpClient.class
responseString = responseString.trim();
JSONObject jsonResponse = new JSONObject(responseString);
Object jsonError = jsonResponse.get("error");
if(!jsonError.equals((Object)null)) {
throw new JSONRPCException(jsonError);
} else {
return jsonResponse;
}
I am not sure it is a practice to add "error" in to response JSON since I am quite new to android development. Is there any sophisticate way to work around this?
The exception thrown is: org.json.JSONException: No value for error