title: How to handle 404 in webclient retrive
body: <p>I am new to spring webclient and i have written a generic method which can be used to consume rest apis in my application:</p>
  <pre><code>public &lt;T&gt; List&lt;T&gt; get(URI url, Class&lt;T&gt; responseType) {
          return  WebClient.builder().build().get().uri(url)
                     .header(&quot;Authorization&quot;, &quot;Basic &quot; + principal)
                     .retrieve().bodyToFlux(responseType).collectList().block();
  }
  </code></pre>
  <p>i wanted to return and empty list if consumed rest-api return 404.</p>
  <p>can someone suggest how to achieve that?</p>