use of com.shizhefei.mvc.http.NetworkExeption in project MVCHelper by LuckyJayce.
the class MeizhiParser method parseImp.
protected DATA parseImp(Response response) throws Exception {
if (response.isSuccessful()) {
String json = response.body().string();
JSONObject jsonObject = new JSONObject(json);
boolean error = jsonObject.getBoolean("error");
if (!error) {
String result = jsonObject.getString("results");
DATA data = new JsonParser<DATA>(getClass()) {
}.parse(result);
return data;
}
throw new BizException();
}
throw new NetworkExeption(response);
}
Aggregations