nfsantos commented on code in PR #649:
URL: https://github.com/apache/jackrabbit-oak/pull/649#discussion_r951560137
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -341,8 +343,16 @@ public void onFailure(Throwable t) {
LOG.warn("Error reference for async iterator was previously
set to {}. It has now been reset to new error {}", error.getMessage(),
t.getMessage());
}
+ if (t instanceof ElasticsearchException) {
+ ElasticsearchException esException = (ElasticsearchException)
t;
+ StringBuffer errorMessage = new StringBuffer("Status: " +
esException.status() + ", Message: " + esException.getMessage());
+ for (ErrorCause c :
esException.response().error().rootCause()) {
Review Comment:
I added null checks for all the intermediate calls. In the current version
of the library that we use, they never return null, but as you say, this is not
stated in the Javadocs so it can change in the future, so better to safeguard
against that possibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]