ivankelly commented on a change in pull request #1809: Change LedgerManager to use CompletableFuture URL: https://github.com/apache/bookkeeper/pull/1809#discussion_r234236380
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BKException.java ########## @@ -439,12 +439,22 @@ public BKLedgerIdOverflowException() { * Extract an exception code from an BKException, or use a default if it's another type. */ public static int getExceptionCode(Throwable t, int defaultCode) { - if (t instanceof BKException) { + if (t == null) { + return BKException.Code.OK; + } else if (t instanceof BKException) { return ((BKException) t).getCode(); } else if (t.getCause() != null) { Review comment: You'll get CompletionException wrapping, if the future you put your handler is not the future on which completeExceptionally is called. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services