Skip to content

Commit ea32d62

Browse files
Fixed assignment to catch block parameter (#15384)
Signed-off-by: Dmitry Kryukov <[email protected]> (cherry picked from commit ebcf5e3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 9c2d17f commit ea32d62

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

server/src/main/java/org/opensearch/search/SearchService.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,14 +722,15 @@ private SearchPhaseResult executeQueryPhase(ShardSearchRequest request, SearchSh
722722
}
723723
} catch (Exception e) {
724724
// execution exception can happen while loading the cache, strip it
725-
if (e instanceof ExecutionException) {
726-
e = (e.getCause() == null || e.getCause() instanceof Exception)
727-
? (Exception) e.getCause()
728-
: new OpenSearchException(e.getCause());
725+
Exception exception = e;
726+
if (exception instanceof ExecutionException) {
727+
exception = (exception.getCause() == null || exception.getCause() instanceof Exception)
728+
? (Exception) exception.getCause()
729+
: new OpenSearchException(exception.getCause());
729730
}
730-
logger.trace("Query phase failed", e);
731-
processFailure(readerContext, e);
732-
throw e;
731+
logger.trace("Query phase failed", exception);
732+
processFailure(readerContext, exception);
733+
throw exception;
733734
} finally {
734735
taskResourceTrackingService.writeTaskResourceUsage(task, clusterService.localNode().getId());
735736
}

0 commit comments

Comments
 (0)