Skip to content

Commit

Permalink
refact: improve error info of edge-update-api (#1443)
Browse files Browse the repository at this point in the history
  • Loading branch information
imbajin authored May 11, 2021
1 parent 4907886 commit 727b93c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public String update(@Context GraphManager manager,

if (jsonEdge.id != null) {
E.checkArgument(id.equals(jsonEdge.id),
"The ids are different between url('%s') and " +
"request body('%s')", id, jsonEdge.id);
"The ids are different between url and " +
"request body ('%s' != '%s')", id, jsonEdge.id);
}

// Parse action param
Expand Down Expand Up @@ -458,8 +458,11 @@ private Id getEdgeId(HugeGraph g, JsonEdge newEdge) {
HugeVertex.getIdValue(newEdge.target));
if (newEdge.id != null) {
E.checkArgument(edgeId.equals(newEdge.id),
"The sort key values either be null " +
"or equal to origin when specified edge id");
"The ids are different between server and " +
"request body ('%s' != '%s'). And note the sort " +
"key values should either be null or equal to " +
"the origin value when specified edge id",
edgeId, newEdge.id);
}
return edgeId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void testBatchUpdate() throws IOException {
// Now allowed to modify sortkey values, the property 'date' has changed
content = assertResponseStatus(400, r);
Assert.assertTrue(content.contains(
"either be null or equal to origin when " +
"either be null or equal to the origin value when " +
"specified edge id"));

// Update edge without edgeId
Expand Down

0 comments on commit 727b93c

Please sign in to comment.