Update TaskList.java

pull/2/head
pa2ltb7y5 11 months ago
parent 8143368e41
commit 4a2731614c

@ -42,8 +42,8 @@ public class TaskList extends Node {
mChildren = new ArrayList<Task>(); mChildren = new ArrayList<Task>();
mIndex = 1; mIndex = 1;
} }
// 创建操作的方法返回一个JSONObject对象
public JSONObject getCreateAction(int actionId) { public JSONObject getCreateAction(int actionId) {// 创建操作的方法返回一个JSONObject对象
JSONObject js = new JSONObject(); JSONObject js = new JSONObject();
try { try {
@ -68,8 +68,8 @@ public class TaskList extends Node {
} catch (JSONException e) { } catch (JSONException e) {
Log.e(TAG, e.toString()); Log.e(TAG, e.toString());
e.printStackTrace(); e.printStackTrace();
// 如果生成JSONObject失败则抛出ActionFailureException异常
throw new ActionFailureException("fail to generate tasklist-create jsonobject"); throw new ActionFailureException("fail to generate tasklist-create jsonobject");// 如果生成JSONObject失败则抛出ActionFailureException异常
} }
return js; return js;
@ -125,8 +125,8 @@ public class TaskList extends Node {
} catch (JSONException e) {// 当出现JSON解析异常时捕获该异常 } catch (JSONException e) {// 当出现JSON解析异常时捕获该异常
Log.e(TAG, e.toString()); Log.e(TAG, e.toString());
e.printStackTrace(); // 打印异常的堆栈跟踪信息,有助于开发人员定位问题 e.printStackTrace(); // 打印异常的堆栈跟踪信息,有助于开发人员定位问题
// 抛出一个新的ActionFailureException异常并附带错误信息
throw new ActionFailureException("fail to get tasklist content from jsonobject"); throw new ActionFailureException("fail to get tasklist content from jsonobject");// 抛出一个新的ActionFailureException异常并附带错误信息
} }
} }
} }

Loading…
Cancel
Save