Browse Source

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>
stable-4.9
Thomas Wolf 7 years ago committed by Matthias Sohn
parent
commit
dbef8e2537
  1. 11
      org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java

11
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java

@ -153,10 +153,13 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
} catch (JSchException je) { } catch (JSchException je) {
final Throwable c = je.getCause(); final Throwable c = je.getCause();
if (c instanceof UnknownHostException) if (c instanceof UnknownHostException) {
throw new TransportException(uri, JGitText.get().unknownHost); throw new TransportException(uri, JGitText.get().unknownHost,
if (c instanceof ConnectException) je);
throw new TransportException(uri, c.getMessage()); }
if (c instanceof ConnectException) {
throw new TransportException(uri, c.getMessage(), je);
}
throw new TransportException(uri, je.getMessage(), je); throw new TransportException(uri, je.getMessage(), je);
} }

Loading…
Cancel
Save