Why? Is that really intended or have I misconfigured anything?
As mentioned by @artem the documentation does mention some fatal exceptions which bypass the custom error handling logic.
DeserializationException
MessageConversionException
ConversionException
MethodArgumentResolutionException
NoSuchMethodException
ClassCastException
Therefore, for anyone willing to apply the same error strategy independently of the origin of the error, the default provided by Spring can be overridden as follow:
@Bean
CommonErrorHandler commonErrorHandler() {
var exponentialBackOff = new ExponentialBackOff();
exponentialBackOff.setMaxInterval(Duration.ofHours(1).toMillis());
var handler = new DefaultErrorHandler(exponentialBackOff);
handler.setClassifications(Map.of(), true);
return handler;
}