Merge "PatchListCacheImpl: Correctly handle LargeObjectException"
This commit is contained in:
commit
8d02290d84
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user