Skip to content

Commit

Permalink
ElasticSearchExceptionTests guessRootCauses fix
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 committed Jan 8, 2020
1 parent 8933919 commit c1544de
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 c1544de

Please sign in to comment.