Catch RuntimeException instead of Exception in PushAll and ReplicationQueue Prepare for enabling Error Prone's CatchingUnchecked rule. Release-Notes: skip Change-Id: I625d2253aba2af823cff6be03a221104b9126143
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushAll.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushAll.java index 19ae420..80fc210 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushAll.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushAll.java
@@ -83,7 +83,7 @@ replication.scheduleFullSync(nameKey, urlMatch, refName, remotesToConsider, state, now); } } - } catch (Exception e) { + } catch (RuntimeException e) { stateLog.error("Cannot enumerate known projects", e, state); } state.markAllPushTasksScheduled();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java index 9827091..2ff785e 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java
@@ -392,7 +392,7 @@ } try { synchronizePendingEvents(Prune.TRUE); - } catch (Exception e) { + } catch (RuntimeException e) { repLog.atSevere().withCause(e).log("error distributing tasks"); } }