title: Throwing exception from CompletableFuture
body: <p>I have the following code: </p>
  
  <pre><code>// How to throw the ServerException?
  public void myFunc() throws ServerException{
      // Some code
      CompletableFuture&lt;A&gt; a = CompletableFuture.supplyAsync(() -&gt; {
          try {
              return someObj.someFunc();
          } catch(ServerException ex) {
              // throw ex; gives an error here.
          }
      }));
      // Some code
  }
  </code></pre>
  
  <p><code>someFunc()</code> throws a <code>ServerException</code>. I don't want to handle this here but throw the exception from <code>someFunc()</code> to caller of <code>myFunc()</code>. </p>