Created
June 30, 2020 21:27
-
-
Save theboreddev/1b1e810c125be061178eef5d70289cb4 to your computer and use it in GitHub Desktop.
exceptionally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CompletableFuture<Result> chain = CompletableFuture.runAsync(() -> System.out.println("Start")) | |
.thenCombine(subTask, (nil, text) -> { | |
if (text == null || text.isEmpty()) | |
throw new IllegalArgumentException("Text cannot be null or empty!"); | |
return Result.COMPLETED; | |
}) | |
.exceptionally(exception -> Result.FAILED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment