Special case UnknownHostKey during replication
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/src/main/java/com/google/gerrit/git/PushQueue.java b/src/main/java/com/google/gerrit/git/PushQueue.java
index af94cfd..7c6c035 100644
--- a/src/main/java/com/google/gerrit/git/PushQueue.java
+++ b/src/main/java/com/google/gerrit/git/PushQueue.java
@@ -19,6 +19,7 @@
import com.google.gwtjsonrpc.server.XsrfException;
import com.google.gwtorm.client.OrmException;
+import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import org.slf4j.Logger;
@@ -176,6 +177,12 @@
log.error("Cannot replicate to " + op.uri, e);
return;
} catch (TransportException e) {
+ final Throwable cause = e.getCause();
+ if (cause instanceof JSchException
+ && cause.getMessage().startsWith("UnknownHostKey:")) {
+ log.error("Cannot replicate to " + op.uri + ": " + cause.getMessage());
+ return;
+ }
log.error("Cannot replicate to " + op.uri, e);
return;
} finally {