title: Feign ErrorDecoder is not invoked - how to configure feign to use it?
body: <p>As i understand the decode() method of the feign ErrorDecoder will be called when a request responds with a status code != 2xx. Through debugging my tests i found out that the decode() method of my CustomErrorDecoder is not invoked on e.g. 504 or 404. I tried two ways to configure it:</p>
  <p>Either include it as a Bean in the client configuration:</p>
  <pre><code>    @Bean
      public CustomErrorDecoder customErrorDecoder() {
          return new CustomErrorDecoder();
      }
  </code></pre>
  <p>or write it into the application configuration :</p>
  <pre><code>feign:
    client:
      config:
        myCustomRestClientName:
          retryer: com.a.b.some.package.CustomRetryer
          errorDecoder: com.a.b.some.package.CustomErrorDecoder
  </code></pre>
  <p>Both ways don't invoke the ErrorDecoder. What am I doing wrong? The Bean is beeing instantiated and my CustomErrorDecoder looks like this:</p>
  <pre><code>@Component
  public class CustomErrorDecoder implements ErrorDecoder {
  
      private final ErrorDecoder defaultErrorDecoder = new Default();
  
      @Override
      public Exception decode(String s, Response response) {
          Exception exception = defaultErrorDecoder.decode(s, response);
  
          if (exception instanceof RetryableException) {
              return exception;
          }
  
          if (response.status() == 504) {
              // throwing new RetryableException to retry 504s
          }
          return exception;
      }
  }
  </code></pre>
  <hr />
  <h2>Update:</h2>
  <p>I have created  a minimal reproducible example in <del>this git repo</del>. Please look at the commit history to find 3 ways that I tried.</p>