chia7712 commented on code in PR #15462: URL: https://github.com/apache/kafka/pull/15462#discussion_r1516221969
########## server-common/src/main/java/org/apache/kafka/server/util/FutureUtils.java: ########## @@ -125,4 +127,21 @@ public static <T> CompletableFuture<T> combineFutures( return res; }); } + + /** + * Applies the given exception handler to all the futures provided in the list + * and returns a new list of futures. + * + * @param futures A list of futures. + * @param fn A function taking an exception to handle it. + * @return A list of futures. + */ + public static <T> List<CompletableFuture<T>> mapExceptionally( Review Comment: That makes sense to me. We can leave some rooms for refactor if there will be more use cases in the future. Let ship it instead of being over-engineering :) -- 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