cadonna commented on PR #14746:
URL: https://github.com/apache/kafka/pull/14746#issuecomment-1812010386

   @philipnee @kirktrue Thanks for your comments and explanation! I totally 
missed that if the future is completed exceptionally it throws an 
`ExecutionException`. The javadocs of `completeExceptionally()` state:
   ```
   If not already completed, causes invocations of get() and related methods to 
throw the given exception.
   ```
   It does not say anything about wrapping. I just saw now that the javadocs of 
`CompletableFuture` state it more clearly:
   ```
   In case of exceptional completion with a CompletionException, methods get() 
and get(long, TimeUnit) throw an ExecutionException with the same cause as held 
in the corresponding CompletionException.
   ```  
   I misunderstood the javadocs on `get()`. I modified the code to use 
`getNow()` which makes the handling a bit simpler. 


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to