Skip to content

Commit

Permalink
Honour ErrorHandler if Cache.put fails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dbrimley authored and snicoll committed Feb 6, 2017
1 parent 7796c4d commit 3476d10
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -59,7 +59,7 @@ protected Object invoke(CacheOperationInvocationContext<CacheResultOperation> co

try {
Object invocationResult = invoker.invoke();
cache.put(cacheKey, invocationResult);
doPut(cache, cacheKey, invocationResult);
return invocationResult;
}
catch (CacheOperationInvoker.ThrowableWrapper ex) {
Expand Down Expand Up @@ -88,7 +88,7 @@ protected void cacheException(Cache exceptionCache, ExceptionTypeFilter filter,
return;
}
if (filter.match(ex.getClass())) {
exceptionCache.put(cacheKey, ex);
doPut(exceptionCache, cacheKey, ex);
}
}

Expand Down

0 comments on commit 3476d10

Please sign in to comment.