title: How to manage Feign errors?
body: <p>We are using <em>Spring-boot</em> with <em>Spring-cloud</em> and <em>Spring-cloud-netflix</em> with <em>Spring-cloud-feign</em>.</p>
  
  <p>We are creating our Gateway application that with the help of <code>Feign</code> will try to communicate with our <code>authentication</code> microservice in order to validate their credentials. Here you can see an example of our Feign <code>authentication</code> client:</p>
  
  <pre><code>@FeignClient(value="auth", configuration = AuthClientConfiguration.class)
  
  public interface AuthClient {
     @RequestMapping(method = RequestMethod.GET, value = "/tokens", consumes = MediaType.APPLICATION_JSON_VALUE)
     Single&lt;Session&gt; getSession(@RequestHeader("Authorization") String token);
  }
  </code></pre>
  
  <p>The question is, how we can deal with all the exceptions that could be raised by the client? I mean, how we can for example catch that a <code>NetworkException</code> or a <code>TimeoutException</code> has been thrown? We've defined our own <code>ErrorDecoder</code> but it appears that this "kind of listener" only works when the request has arrived and the response returned (in our case from <code>authentication</code> client). So, how we can manage this other exceptions? </p>
  
  <p>Best,</p>