Skip to content

Commit

Permalink
errors are not json objects as opposed to strings, fixing accordingly.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejserafim committed Oct 17, 2015
1 parent 11b39bf commit 9f1789b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public BulkResultItem(String operation, JsonObject values) {
this.type = values.get("_type").getAsString();
this.id = values.get("_id").getAsString();
this.status = values.get("status").getAsInt();
this.error = values.has("error") ? values.get("error").getAsString() : null;
this.error = values.has("error") ? values.get("error").toString() : null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public void bulkOperationWithIndexCreateOpType() throws IOException {

// second index request with create op type should fail because it's a duplicate of the first index request
assertNotNull(
result.getJsonObject().getAsJsonArray("items").get(1).getAsJsonObject().getAsJsonObject("create").get("error").getAsString()
result.getJsonObject().getAsJsonArray("items").get(1).getAsJsonObject().getAsJsonObject("create").get("error").getAsJsonObject().get("reason").getAsString()
);
}

Expand Down

0 comments on commit 9f1789b

Please sign in to comment.