title: Throwing exceptions from within CompletableFuture exceptionally clause
body: <p>I am having a problem dealing with exceptions throw from CompletableFuture methods. I thought it should be possible to throw an exception from within the exceptionally clause of a CompletableFuture. For example, in the method below, I expected that <code>executeWork</code> would throw a RuntimeException because I am throwing one in the various <code>exceptionally</code> clauses, however, this does not work and I'm not sure why.</p>
  <pre><code>public void executeWork() {
  
    service.getAllWork().thenAccept(workList -&gt; {
      for (String work: workList) {
        service.getWorkDetails(work)
          .thenAccept(a -&gt; sendMessagetoQueue(work, a))
          .exceptionally(t -&gt; {
            throw new RuntimeException(&quot;Error occurred looking up work details&quot;);
          });
      }
    }).exceptionally(t -&gt; {
      throw new RuntimeException(&quot;Error occurred retrieving work list&quot;);
    });
  }
  </code></pre>