[prev in list] [next in list] [prev in thread] [next in thread]
List: git
Subject: Re: [JGIT PATCH] Disambiguate "push not supported" from "repository not found"
From: Robin Rosenberg <robin.rosenberg () dewire ! com>
Date: 2008-08-31 8:28:58
Message-ID: 200808311028.59348.robin.rosenberg () dewire ! com
[Download RAW message or body]
fredagen den 29 augusti 2008 16.31.16 skrev Shawn O. Pearce:
> Marek Zawirski <marek.zawirski@gmail.com> wrote:
> > Robin Rosenberg wrote:
> > >
> > > Why an extra method for instantiating the exception?
> >
> > Isn't it overrode in subclass - BasePackPushConnection?
>
> Correct. I introduced the method so the subclass can inject its
> own implementation for the catch block. But its required to give
> back a TransportException so the catch block can throw it, as we
> do not want the subclass to be able to continue at this point.
Mind if I squash this into the patch?
-- robin
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java \
b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java index \
e35f850..16e4897 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
@@ -182,6 +182,15 @@ private void readAdvertisedRefsImpl() throws IOException {
available(avail);
}
+ /**
+ * Create an exception to indicate problems finding a remote repository. The
+ * caller is expected to throw the returned exception.
+ *
+ * Subclasses may override this method to provide better diagnostics.
+ *
+ * @return a TransportException saying a repository cannot be found and
+ * possibly why.
+ */
protected TransportException noRepository() {
return new NoRemoteRepositoryException(uri, "not found.");
}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic