Bladeren bron

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>
tags/v0.7.0
Shawn O. Pearce 14 jaren geleden
bovenliggende
commit
dd931bd978
1 gewijzigde bestanden met toevoegingen van 3 en 13 verwijderingen
  1. 3
    13
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java

+ 3
- 13
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java Bestand weergeven

/* /*
* Copyright (C) 2009-2010, Google Inc.
* Copyright (C) 2008-2010, Google Inc.
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* and other copyright owners as documented in the project's IP log. * and other copyright owners as documented in the project's IP log.
* *


init(advertisement, DisabledOutputStream.INSTANCE); init(advertisement, DisabledOutputStream.INSTANCE);
outNeedsEnd = false; outNeedsEnd = false;
try {
readAdvertisedRefs();
} catch (IOException err) {
close();
throw new TransportException(uri, "remote hung up", err);
}
readAdvertisedRefs();
} }


@Override @Override


init(advertisement, DisabledOutputStream.INSTANCE); init(advertisement, DisabledOutputStream.INSTANCE);
outNeedsEnd = false; outNeedsEnd = false;
try {
readAdvertisedRefs();
} catch (IOException err) {
close();
throw new TransportException(uri, "remote hung up", err);
}
readAdvertisedRefs();
} }


protected void doPush(final ProgressMonitor monitor, protected void doPush(final ProgressMonitor monitor,

Laden…
Annuleren
Opslaan