Skip to content

Commit

Permalink
Fix RestStatusException cause.
Browse files Browse the repository at this point in the history
Original Pull Request #1996
Closes #1995
  • Loading branch information
sothawo authored Nov 16, 2021
1 parent 0b4c5b4 commit 45b4c99
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
}

if (elasticsearchException instanceof ElasticsearchStatusException) {
ElasticsearchStatusException restStatusException = (ElasticsearchStatusException) elasticsearchException;
return new RestStatusException(restStatusException.status().getStatus(), restStatusException.getMessage(),
restStatusException.getCause());
ElasticsearchStatusException elasticsearchStatusException = (ElasticsearchStatusException) elasticsearchException;
return new RestStatusException(elasticsearchStatusException.status().getStatus(),
elasticsearchStatusException.getMessage(), elasticsearchStatusException);
}

return new UncategorizedElasticsearchException(ex.getMessage(), ex);
Expand Down

0 comments on commit 45b4c99

Please sign in to comment.