title: Spring Boot how to ignore HttpStatus Exceptions
body: <p>I'm building an Application using Spring Boot. This application is distributed, which means I have multiple API's that call each others.</p>
  
  <p>One of my underlying services interacts with a database and responds with the requested data. If a request to an unexisting ID is made, I response with a 404 HttpStatus: </p>
  
  <pre><code>return new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND);
  </code></pre>
  
  <p>(Same with 400 error on certain operations, or 204 for deleting an entry etc).</p>
  
  <p>The problem is that I have some other Spring Boot applications that call these API's, throw an <code>org.springframework.web.client.HttpClientErrorException: 404 Not Found</code> Exception when they request, in this example, an unexisting entry. But the 404 status code is intended and should not return this exception (causing my Hystrix circuit breaker to call its fallback function).</p>
  
  <p>How can I solve this problem?</p>
  
  <p>The call to the service is implemented like this in my code: <code>ResponseEntity&lt;Object&gt; data = restTemplate.getForEntity(url, Object.class);</code></p>
  
  <p>My RestTemplate is set up like this: </p>
  
  <pre><code>private RestTemplate restTemplate = new RestTemplate();
  </code></pre>