Skip to content

Commit

Permalink
ElasticSearchExceptionTests guessRootCauses fix (#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 #50525
  • Loading branch information
henningandersen authored Jan 8, 2020
1 parent 4b366a4 commit c0bebf8
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 c0bebf8

Please sign in to comment.