我有一组使用镜像API 的时间轴项目,现在我正在尝试从包中更改时间轴的内容。但是发生以下错误
An error occurred from update timeline : com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "Not Found",
"reason" : "notFound"
} ],
"message" : "Not Found"
}
更新方法如下所示
public static TimelineItem updateTimelineItem(Credential credential,
String itemId, String newText) {
try {
Mirror.Timeline timeline = getMirror(credential).timeline();
TimelineItem timelineItem = timeline.get(itemId).execute();
timelineItem.setText(newText);
return timeline.update(itemId, timelineItem).execute();
} catch (IOException e) {
System.err.println("\nAn error occurred from update timeline : " + e);
return null;
}
}
首先我尝试检索时间轴项目,当我写执行时,然后发生错误
Mirror.Timeline timeline = getMirror(credential).timeline();
TimelineItem timelineItem = timeline.get(itemId).execute();
我该如何解决?
答案 0 :(得分:0)
您发布的例外情况并不完全清楚,但看起来itemId无效。你是如何获得这个itemId的,你可以验证它是timeline.get还是导致问题的timeline.update?