git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Bruhat (BooK)" <book@cpan.org>
To: git@vger.kernel.org
Cc: "Philippe Bruhat (BooK)" <book@cpan.org>
Subject: [PATCH] Git.pm: better error message
Date: Fri, 18 Jun 2010 01:47:31 +0200	[thread overview]
Message-ID: <1276818451-17003-1-git-send-email-book@cpan.org> (raw)
In-Reply-To: <1276477222-21465-1-git-send-email-book@cpan.org>

Provide the bad directory name alongside with $!

Note: $! is set if there is "No such file or directory",
but isn't set if the file exists but is not a directory.

Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>
---
 perl/Git.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 1926dc9..6cb0dd1 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -172,7 +172,7 @@ sub repository {
 	}
 
 	if (defined $opts{Directory}) {
-		-d $opts{Directory} or throw Error::Simple("Directory not found: $!");
+		-d $opts{Directory} or throw Error::Simple("Directory not found: $opts{Directory} $!");
 
 		my $search = Git->repository(WorkingCopy => $opts{Directory});
 		my $dir;
@@ -545,7 +545,7 @@ sub wc_chdir {
 		or throw Error::Simple("bare repository");
 
 	-d $self->wc_path().'/'.$subdir
-		or throw Error::Simple("subdir not found: $!");
+		or throw Error::Simple("subdir not found: $subdir $!");
 	# Of course we will not "hold" the subdirectory so anyone
 	# can delete it now and we will never know. But at least we tried.
 
-- 
1.7.0.4

      parent reply	other threads:[~2010-06-17 23:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  1:00 [PATCH] Git.pm: better error message Philippe Bruhat (BooK)
2010-06-14  7:10 ` Jeff King
2010-06-14  9:19   ` Philippe Bruhat (BooK)
2010-06-14  9:20     ` Jeff King
2010-06-17 23:47 ` Philippe Bruhat (BooK) [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=1276818451-17003-1-git-send-email-book@cpan.org \
    --to=book@cpan.org \
    --cc=git@vger.kernel.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 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).