Skip to content

Commit

Permalink
Fixed assignment to catch block parameter (#15384) (#16368)
Browse files Browse the repository at this point in the history
(cherry picked from commit ebcf5e3)

Signed-off-by: Dmitry Kryukov <dk2k@ya.ru>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 9c2d17f commit f9efd53
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 @@ -722,14 +722,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 f9efd53

Please sign in to comment.