diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-02-11 11:39:09 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-02-11 11:44:37 -0800 |
commit | dd931bd9785661ac4145b3625b94e9f23c29cb03 (patch) | |
tree | 9d722491e5563d66cba9d11c84fa1ed0f1656858 /org.eclipse.jgit | |
parent | e54d33b6873f0b392640f9200398861210ac9374 (diff) | |
download | jgit-dd931bd9785661ac4145b3625b94e9f23c29cb03.tar.gz jgit-dd931bd9785661ac4145b3625b94e9f23c29cb03.zip |
Don't doubly wrap TransportException in smart HTTP client
If the readAdvertisedRefs() method throws an exception, its already
closed the connection and wrapped the underlying cause inside of a
suitable TransportException object that it is throwing. We shouldn't
catch IOException and rethrow a wrapped copy here, because we'll double
wrap the exception thrown by readAdvertisedRefs. This may obsecure the
root cause of the connection failure from the end-user.
Change-Id: I0ca61560f9888c666323dac8a5582aab25e897ff
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java index c53bcf2601..8de16c13d0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2010, Google Inc. + * Copyright (C) 2008-2010, Google Inc. * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> * and other copyright owners as documented in the project's IP log. * @@ -572,12 +572,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, init(advertisement, DisabledOutputStream.INSTANCE); outNeedsEnd = false; - try { - readAdvertisedRefs(); - } catch (IOException err) { - close(); - throw new TransportException(uri, "remote hung up", err); - } + readAdvertisedRefs(); } @Override @@ -598,12 +593,7 @@ public class TransportHttp extends HttpTransport implements WalkTransport, init(advertisement, DisabledOutputStream.INSTANCE); outNeedsEnd = false; - try { - readAdvertisedRefs(); - } catch (IOException err) { - close(); - throw new TransportException(uri, "remote hung up", err); - } + readAdvertisedRefs(); } protected void doPush(final ProgressMonitor monitor, |