diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java index eb1d2ac0a9..b87a85d934 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java @@ -139,7 +139,7 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen /** {@inheritDoc} */ @Override - protected TransportException noRepository() { + protected TransportException noRepository(Throwable cause) { // Sadly we cannot tell the "invalid URI" case from "push not allowed". // Opening a fetch connection can help us tell the difference, as any // useful repository is going to support fetch if it also would allow @@ -147,18 +147,18 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen // URI is wrong. Otherwise we can correctly state push isn't allowed // as the fetch connection opened successfully. // + TransportException te; try { transport.openFetch().close(); - } catch (NotSupportedException e) { - // Fall through. + te = new TransportException(uri, JGitText.get().pushNotPermitted); } catch (NoRemoteRepositoryException e) { // Fetch concluded the repository doesn't exist. - // - return e; - } catch (TransportException e) { - // Fall through. + te = e; + } catch (NotSupportedException | TransportException e) { + te = new TransportException(uri, JGitText.get().pushNotPermitted, e); } - return new TransportException(uri, JGitText.get().pushNotPermitted); + te.addSuppressed(cause); + return te; } /** |