Skip to content
Permalink
Browse files

Include Lightblue responses in LightblueBulkResponseException message

  • Loading branch information
paterczm committed Oct 6, 2016
1 parent 12294d3 commit 9ba49cf58bf888de73b2a854ee6103f0d8dc5ece
@@ -15,7 +15,7 @@
public LightblueBulkResponseException(String message,
LightblueBulkDataErrorResponse bulkResponse,
Map<Integer, LightblueResponseException> erroredResponseExceptions) {
super(message);
super(message+": "+bulkResponse.getText());
this.bulkResponse = bulkResponse;
this.erroredResponseExceptions = erroredResponseExceptions;
}
@@ -222,6 +222,8 @@ public void testBulkException_ErroredResponses() throws Exception {
assertFalse(responses.contains(e.getBulkResponse().getResponse(dfr)));
assertEquals(responses.get(0), e.getBulkResponse().getResponse(dfrErrored));
assertFalse(responses.contains(e.getBulkResponse().getResponse(dfr2)));

assertEquals("Message should contain all responses", "Errors returned in responses: {\"responses\":[{\"seq\":0,\"response\":{\"status\":\"COMPLETE\",\"modifiedCount\":0,\"matchCount\":1,\"processed\":[{\"identity#\":1,\"entityName\":\"foo\",\"lastUpdateDate\":\"\",\"versionText\":\"1.0.0\",\"_id\":\"\",\"audits#\":5,\"objectType\":\"audit\"}]}},{\"seq\":1,\"response\":{\"status\":\"ERROR\",\"modifiedCount\":0,\"matchCount\":0,\"errors\":[{\"context\":\"some context\",\"errorCode\":\"errCode\",\"msg\":\"some msg\",\"status\":\"ERROR\"}]}},{\"seq\":2,\"response\":{\"status\":\"COMPLETE\",\"modifiedCount\":0,\"matchCount\":1,\"processed\":[{\"identity#\":1,\"entityName\":\"foo\",\"lastUpdateDate\":\"\",\"versionText\":\"1.0.0\",\"_id\":\"\",\"audits#\":5,\"objectType\":\"audit\"}]}}]}", e.getMessage());
}
}

0 comments on commit 9ba49cf

Please sign in to comment.
You can’t perform that action at this time.