You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "reta (via GitHub)" <gi...@apache.org> on 2023/08/22 00:23:32 UTC

[GitHub] [lucene] reta commented on a diff in pull request #12516: Unwrap execution exceptions cause and rethrow as is when possible

reta commented on code in PR #12516:
URL: https://github.com/apache/lucene/pull/12516#discussion_r1300778596


##########
lucene/core/src/java/org/apache/lucene/search/TaskExecutor.java:
##########
@@ -57,6 +58,12 @@ final <T> List<T> invokeAll(Collection<RunnableFuture<T>> tasks) {
       } catch (InterruptedException e) {
         throw new ThreadInterruptedException(e);
       } catch (ExecutionException e) {
+        if (e.getCause() instanceof IOException ioException) {
+          throw ioException;

Review Comment:
   ```suggestion
             throw e.getCause();
   ```



##########
lucene/core/src/java/org/apache/lucene/search/TaskExecutor.java:
##########
@@ -57,6 +58,12 @@ final <T> List<T> invokeAll(Collection<RunnableFuture<T>> tasks) {
       } catch (InterruptedException e) {
         throw new ThreadInterruptedException(e);
       } catch (ExecutionException e) {
+        if (e.getCause() instanceof IOException ioException) {
+          throw ioException;

Review Comment:
   ```suggestion
             throw e.getCause();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org