summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Kempin <edwin.kempin@sap.com>2013-11-18 16:56:10 +0100
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-11-19 04:32:20 +0000
commit5cefcbfc68a8d7b49d1d98d36c5dfbb09de28923 (patch)
tree2836d8220e2d141e961caa454d2d5e0fc7f00222
parentebfff02c75d02c9e9ed2b54053cf696fd7b8794f (diff)
Make sure all exceptions during GC are caught and logged
Change-Id: I607d60b938c57d84a3590af9bd779e22f028da16 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com> (cherry picked from commit 4519a9054920cdb1b95c4c6e7e34211022846e3b)
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/git/GarbageCollection.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/GarbageCollection.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/GarbageCollection.java
index 685e87caa9..24af14d8d8 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/GarbageCollection.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/GarbageCollection.java
@@ -21,8 +21,6 @@ import com.google.inject.Inject;
import org.eclipse.jgit.api.GarbageCollectCommand;
import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.errors.GitAPIException;
-import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.ConfigConstants;
@@ -33,7 +31,6 @@ import org.eclipse.jgit.storage.pack.PackConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Properties;
@@ -91,15 +88,7 @@ public class GarbageCollection {
result.addError(new GarbageCollectionResult.Error(
GarbageCollectionResult.Error.Type.REPOSITORY_NOT_FOUND,
p));
- } catch (IOException e) {
- logGcError(writer, p, e);
- result.addError(new GarbageCollectionResult.Error(
- GarbageCollectionResult.Error.Type.GC_FAILED, p));
- } catch (GitAPIException e) {
- logGcError(writer, p, e);
- result.addError(new GarbageCollectionResult.Error(
- GarbageCollectionResult.Error.Type.GC_FAILED, p));
- } catch (JGitInternalException e) {
+ } catch (Exception e) {
logGcError(writer, p, e);
result.addError(new GarbageCollectionResult.Error(
GarbageCollectionResult.Error.Type.GC_FAILED, p));