在开发中不应该直接把ErrorMessage提示给用户,可以通过获取ErrorCode经过处理后提示给用户。

AVException avException = new AVException(e);
int code = avException.getCode();
JSONObject errorcode = new JSONObject();
try {
errorcode.put("code",code);
errorcode.put("message",e.getMessage());
switch (errorcode.getInt("code")){
//在这里写处理errorcode的方法
}
} catch (JSONException jsonException) {
jsonException.printStackTrace();
}