In Spring, by default, SimpleCacheErrorHandler is used and simply throws the exception back at the client.
To change this behavior, e.g. not throwing any error during cache failure, we can use CachingConfigurerSupport to override the CacheErrorHandler.
@Configuration
@EnableCaching
public class AppConfig extends CachingConfigurerSupport {
@Bean
@Override
public CacheErrorHandler errorHandler() {
// configure and return CacheErrorHandler instance
}
// ...
}