Is your feature request related to a problem? Please describe. we are heavily using the feign-annotation-error-decoder from OpenFeign in our project. Currently, We need to provide in each OpenFeign interface an additional configuration which provides an ErrorDecoder bean by using the following definition

@Bean
public ErrorDecoder errorDecoder() {
    return AnnotationErrorDecoder.builderFor(OpenFeignInterface.class).build();
}

where OpenFeignInterface.class is the Interface with all the OpenFeign annotations plus the @ErrorHandling annotations. This config is nearly every time the same except the class which needs to be provided to the builder.

Describe the solution you'd like My idea is to have a ErrorDecoderFactory interface with one method which takes the interface class as an input and return the ErrorDecoder, similar to what is currently available for creating loggers.

public interface ErrorDecoderFactory {
    /**
     * Factory method to provide a {@link ErrorDecoder} for a given {@link Class}.
     * @param type the {@link Class} for which a {@link ErrorDecoder} instance is to be created
     * @return a {@link ErrorDecoder} instance
     */
    ErrorDecoder create(Class<?> type);
}

so in that case there needs only one bean available implementing the ErrorDecoderFactory interface in the context which allows us to create a specific ErrorDecoder. That simplifies and reduces the amount of code which needs to be written for each interface.

The implementation of checking if a factory bean is available can be done inside the FeignClientFactoryBean in two ways: - if such a bean is available use it and create the ErrorDecoder, if not use the default ErrorDecoder by not setting the ErrorDecoder in the Feign.Builder - provide a default FeignClientFactoryBean implementation which returns the default ErrorDecoder and adding an additional Bean definition to FeignClientsConfiguration with a @ConditionalOnMissingBean

Describe alternatives you've considered tried to extend FeignClientFactoryBean but this implementation is package protected so it is not that easy to extend

Additional context