You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More generally, CompletableFuture is a functor and a monad (lecture 12 pg 17). What the sendAsync method does is return a HttpResponse wrapped in a CompletableFuture. If you look at the java API for HttpClient, you will see that send throws some exceptions of which IOException is one of them. However, SendAsync only throws IllegalArgumentException. All other exceptions would be handled in CompletableFuture similar to how the Sandbox in lecture 7 handles exceptions. If there is an IOException, it would be thrown when you do CompletableFuture.join(), so simply assigning a variable a HttpResponse wrapped in a CompletableFuture will not throw a IOException. Hope this helps!
Description
How do we catch the IO exception expected from the first task run asynchronously?


Topic:
Asynchronous
Screenshots (if any):
Insert Images here if necessary
The text was updated successfully, but these errors were encountered: