Skip to content

Commit d140044

Browse files
committed
Fixed assignment to catch block parameter
Signed-off-by: Dmitry Kryukov <dk2k@ya.ru>
1 parent abb1041 commit d140044

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,14 +680,15 @@ private SearchPhaseResult executeQueryPhase(ShardSearchRequest request, SearchSh
680680
}
681681
} catch (Exception e) {
682682
// execution exception can happen while loading the cache, strip it
683-
if (e instanceof ExecutionException) {
684-
e = (e.getCause() == null || e.getCause() instanceof Exception)
685-
? (Exception) e.getCause()
686-
: new OpenSearchException(e.getCause());
683+
Exception exception = e;
684+
if (exception instanceof ExecutionException) {
685+
exception = (exception.getCause() == null || exception.getCause() instanceof Exception)
686+
? (Exception) exception.getCause()
687+
: new OpenSearchException(exception.getCause());
687688
}
688-
logger.trace("Query phase failed", e);
689-
processFailure(readerContext, e);
690-
throw e;
689+
logger.trace("Query phase failed", exception);
690+
processFailure(readerContext, exception);
691+
throw exception;
691692
} finally {
692693
taskResourceTrackingService.writeTaskResourceUsage(task, clusterService.localNode().getId());
693694
}

0 commit comments

Comments
 (0)