Exception propagation in CompletableFuture (java)

How can I propagate exception encountered in the following code inside CompletableFuture.runAsync to my main thread? I want to catch the IllegalStateException in my main thread. CompletableFuture….