Merge "PatchListCacheImpl: Correctly handle LargeObjectException"

This commit is contained in:
Dave Borowitz 2016-06-24 14:37:48 +00:00 committed by Gerrit Code Review
commit 8d02290d84

View File

@ -16,6 +16,7 @@
package com.google.gerrit.server.patch; package com.google.gerrit.server.patch;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.util.concurrent.UncheckedExecutionException;
import com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace; import com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace;
import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.client.PatchSet;
@ -87,9 +88,15 @@ public class PatchListCacheImpl implements PatchListCache {
throws PatchListNotAvailableException { throws PatchListNotAvailableException {
try { try {
return fileCache.get(key, fileLoaderFactory.create(key, project)); return fileCache.get(key, fileLoaderFactory.create(key, project));
} catch (ExecutionException | LargeObjectException e) { } catch (ExecutionException e) {
PatchListLoader.log.warn("Error computing " + key, e); PatchListLoader.log.warn("Error computing " + key, e);
throw new PatchListNotAvailableException(e.getCause()); throw new PatchListNotAvailableException(e);
} catch (UncheckedExecutionException e) {
if (e.getCause() instanceof LargeObjectException) {
PatchListLoader.log.warn("Error computing " + key, e);
throw new PatchListNotAvailableException(e);
}
throw e;
} }
} }