Honour ErrorHandler if `Cache.put` fails

This commit makes sure that the `ErrorHandler` is invoked if the cache
fails to put an element (be it in the main cache or the exception cache).

See gh-1292
Issue: SPR-15188
This commit is contained in:
David Brimley 2017-01-11 16:29:14 +00:00 committed by Stephane Nicoll
parent c15d687bf0
commit 1fcb2608fb
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ class CacheResultInterceptor extends AbstractKeyCacheInterceptor<CacheResultOper
try {
Object invocationResult = invoker.invoke();
cache.put(cacheKey, invocationResult);
doPut(cache, cacheKey, invocationResult);
return invocationResult;
}
catch (CacheOperationInvoker.ThrowableWrapper ex) {
@ -88,7 +88,7 @@ class CacheResultInterceptor extends AbstractKeyCacheInterceptor<CacheResultOper
return;
}
if (filter.match(ex.getClass())) {
exceptionCache.put(cacheKey, ex);
doPut(exceptionCache, cacheKey, ex);
}
}