git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg@dewire.com>
Cc: Marek Zawirski <marek.zawirski@gmail.com>, git@vger.kernel.org
Subject: Re: [JGIT PATCH] Disambiguate "push not supported" from "repository not found"
Date: Mon, 1 Sep 2008 22:42:13 -0700	[thread overview]
Message-ID: <20080902054213.GE13248@spearce.org> (raw)
In-Reply-To: <200808311028.59348.robin.rosenberg@dewire.com>

Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> 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?

No, not at all.  This looks fine.
 

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

-- 
Shawn.

      reply	other threads:[~2008-09-02  5:44 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
2008-09-02  5:42         ` Shawn O. Pearce [this message]

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=20080902054213.GE13248@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=marek.zawirski@gmail.com \
    --cc=robin.rosenberg@dewire.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).