title: How to handle the exceptions thrown by CompletableFuture.supplyAsync
body: <p>I have the following block of code. I am getting <code>org.springframework.web.context.request.async.AsyncRequestTimeoutException</code> the catch block is not handling that. Can anyone tell me how to handle the exception thrown by the below <code>supplyAsync</code> block?</p>
  
  <pre><code> @org.springframework.scheduling.annotation.Async
      public CompletableFuture&lt;ResponseEntity&lt;?&gt;&gt; getTeam(String teamCode) {
          CompletableFuture.supplyAsync(() -&gt; {
              CricketTeam team;
              try {
                  team = service.getTeamInfo(teamCode);
              } catch (Exception ex) {
                  Error error = new Error(500, ex.getMessage());
                  return new ResponseEntity&lt;&gt;(error, HttpStatus.OK);
              }
              return new ResponseEntity&lt;&gt;(team, HttpStatus.OK);
          });
  
  }
  </code></pre>