All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Marek Zawirski <marek.zawirski@gmail.com>, git@vger.kernel.org
Subject: Re: [JGIT PATCH] Disambiguate "push not supported" from "repository not found"
Date: Sun, 31 Aug 2008 10:28:58 +0200	[thread overview]
Message-ID: <200808311028.59348.robin.rosenberg@dewire.com> (raw)
In-Reply-To: <20080829143116.GB7403@spearce.org>

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.");
        }

  reply	other threads:[~2008-08-31  8:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29  0:18 [JGIT PATCH] Disambiguate "push not supported" from "repository not found" Shawn O. Pearce
2008-08-29  9:20 ` Robin Rosenberg
2008-08-29 12:18   ` Marek Zawirski
2008-08-29 14:31     ` Shawn O. Pearce
2008-08-31  8:28       ` Robin Rosenberg [this message]
2008-09-02  5:42         ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808311028.59348.robin.rosenberg@dewire.com \
    --to=robin.rosenberg@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=marek.zawirski@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.