* @throws Exception
*/
@Deprecated
protected Object parseResult(int id, JsonElement ele, Method method)
throws Exception {
JsonObject res = (JsonObject) ele;
if (!res.get("jsonrpc").getAsString().equals("2.0")) {
throw new InternalErrorException();
}
JsonElement result = res.get("result");
if (result != null) {
if (res.get("id").getAsInt() != id) {
throw new InternalErrorException("no id in response");
} else {
return gson.fromJson(result, method.getGenericReturnType());
}
} else {
JsonElement e = res.get("error");
if (e != null) {
JsonRpcException jre = exceptionHandler.deserialize(e);
if (jre instanceof ServerErrorException) {
String msg = jre.getMessage();
Class<?>[] exp_types = method.getExceptionTypes();