Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CompletableFuture<String> future = new CompletableFuture<>();
- future.completeExceptionally(new RuntimeException());
- future.exceptionally(e -> {
- System.out.println(e.getClass());
- return null;
- });
- CompletableFuture<String> future = new CompletableFuture<>();
- future.completeExceptionally(new RuntimeException());
- future.thenApply(v-> v).exceptionally(e -> {
- System.out.println(e);
- return null;
- });
- CompletableFuture<String> future = new CompletableFuture<>();
- future.completeExceptionally(new RuntimeException());
- future.thenApply(v-> v).exceptionally(e -> {
- System.out.println(e.getCause()); // returns a throwable back
- return null;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement