title: CompletableFuture#exceptionally rethrow checked exception
body: <p>Suppose I want to recover with some value if I get a specific exception, otherwise return the failed future with the exception. I would expect something like this:</p>
  
  <pre><code>public static void main(String[] args) {
      CompletableFuture
              .supplyAsync(FuturesExample::fetchValue)
              .exceptionally(throwable -&gt; {
                  if (throwable instanceof RuntimeException) {
                      return "All good";
                  }
                  throw throwable; // does not compile
              });
  }
  
  public static String fetchValue() {
      // code that potentially throws an exception
      return "value";
  }
  </code></pre>
  
  <p>If the <code>fetchValue</code> function would throw a <em>checked</em> exception, I would like to handle it in the chained methods. I have tried both <code>return throwable</code> and <code>throw throwable</code>, but neither does compile. Do <code>CompletableFuture</code>s offer any solution to this scenario? I am aware that the <code>Function</code> interface that is the parameter of the <code>exceptionally</code> method does not throw any exceptions - I would just like to return the already failed future in this case. I would like to find a solution using Java 8.</p>