Skip to content

Commit ebcf5e3

Browse files
authored
Fixed assignment to catch block parameter (#15384)
Signed-off-by: Dmitry Kryukov <[email protected]>
1 parent e360ceb commit ebcf5e3

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
@@ -721,14 +721,15 @@ private SearchPhaseResult executeQueryPhase(ShardSearchRequest request, SearchSh
721721
}
722722
} catch (Exception e) {
723723
// execution exception can happen while loading the cache, strip it
724-
if (e instanceof ExecutionException) {
725-
e = (e.getCause() == null || e.getCause() instanceof Exception)
726-
? (Exception) e.getCause()
727-
: new OpenSearchException(e.getCause());
724+
Exception exception = e;
725+
if (exception instanceof ExecutionException) {
726+
exception = (exception.getCause() == null || exception.getCause() instanceof Exception)
727+
? (Exception) exception.getCause()
728+
: new OpenSearchException(exception.getCause());
728729
}
729-
logger.trace("Query phase failed", e);
730-
processFailure(readerContext, e);
731-
throw e;
730+
logger.trace("Query phase failed", exception);
731+
processFailure(readerContext, exception);
732+
throw exception;
732733
} finally {
733734
taskResourceTrackingService.writeTaskResourceUsage(task, clusterService.localNode().getId());
734735
}

0 commit comments

Comments
 (0)