Skip to content

Commit

Permalink
Fixed assignment to catch block parameter (#15384)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Kryukov <dk2k@ya.ru>
  • Loading branch information
dk2k committed Oct 17, 2024
1 parent 2b893bc commit ce74105
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions server/src/main/java/org/opensearch/search/SearchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -721,14 +721,15 @@ private SearchPhaseResult executeQueryPhase(ShardSearchRequest request, SearchSh
}
} catch (Exception e) {
// execution exception can happen while loading the cache, strip it
if (e instanceof ExecutionException) {
e = (e.getCause() == null || e.getCause() instanceof Exception)
? (Exception) e.getCause()
: new OpenSearchException(e.getCause());
Exception exception = e;
if (exception instanceof ExecutionException) {
exception = (exception.getCause() == null || exception.getCause() instanceof Exception)
? (Exception) exception.getCause()
: new OpenSearchException(exception.getCause());
}
logger.trace("Query phase failed", e);
processFailure(readerContext, e);
throw e;
logger.trace("Query phase failed", exception);
processFailure(readerContext, exception);
throw exception;
} finally {
taskResourceTrackingService.writeTaskResourceUsage(task, clusterService.localNode().getId());
}
Expand Down

0 comments on commit ce74105

Please sign in to comment.