Skip to content

Commit

Permalink
ElasticSearchExceptionTests guessRootCauses fix (elastic#50752)
Browse files Browse the repository at this point in the history
testFailureToAndFromXContentWithDetails had incorporated that
guessRootCauses returned the wrapper when the underlying exception
was not an ElasticsearchException, fixed.

Relates elastic#50525
  • Loading branch information
henningandersen authored and SivagurunathanV committed Jan 21, 2020
1 parent 3594fb2 commit 95b2a79
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,7 @@ public void testFailureToAndFromXContentWithDetails() throws IOException {
failure = new BroadcastShardOperationFailedException(new ShardId("_index", "_uuid", 5), "F", failureCause);

expected = new ElasticsearchException("Elasticsearch exception [type=file_already_exists_exception, reason=File exists]");
// strangely, the wrapped exception appears as the root cause...
suppressed = new ElasticsearchException("Elasticsearch exception [type=broadcast_shard_operation_failed_exception, " +
"reason=F]");
suppressed = new ElasticsearchException("Elasticsearch exception [type=file_already_exists_exception, reason=File exists]");
expected.addSuppressed(suppressed);
break;

Expand Down

0 comments on commit 95b2a79

Please sign in to comment.