aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2017-08-29 16:55:00 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2017-08-29 15:08:08 -0400
commitdbef8e2537451150529cefd0eb51b69d3e2a19bb (patch)
treefdf0e240c6cdbc3753d7000422b73bcef14f8d8f
parentd684ade3d3520a451a6e1d1c086b64e8c9560552 (diff)
downloadjgit-dbef8e2537451150529cefd0eb51b69d3e2a19bb.tar.gz
jgit-dbef8e2537451150529cefd0eb51b69d3e2a19bb.zip
Pass along the original exception when an ssh connection fails
Otherwise, the stack trace doesn't really tell anything. See for instance [1]. [1] https://www.eclipse.org/forums/index.php/t/1088535/ Change-Id: If22f2c63c36fec6b32818d2c2acecf20531b4185 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
index 242d1c48b6..7fe9066a3d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
@@ -153,10 +153,13 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
} catch (JSchException je) {
final Throwable c = je.getCause();
- if (c instanceof UnknownHostException)
- throw new TransportException(uri, JGitText.get().unknownHost);
- if (c instanceof ConnectException)
- throw new TransportException(uri, c.getMessage());
+ if (c instanceof UnknownHostException) {
+ throw new TransportException(uri, JGitText.get().unknownHost,
+ je);
+ }
+ if (c instanceof ConnectException) {
+ throw new TransportException(uri, c.getMessage(), je);
+ }
throw new TransportException(uri, je.getMessage(), je);
}