From 1c0cfc8726c1c5e4085ad43bdf533b91af88e971 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Feb 2016 00:41:02 +0000 Subject: distinguish error messages intended for users vs developers For error messages intended to show user error (e.g. giving invalid options), we add a newline ("\n") at the end to polluting the output with location information. However, for diagnosing non-user-triggered errors, we should show the location of where the error occured. --- lib/PublicInbox/Config.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/Config.pm') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index b5116388..f84a9550 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -73,7 +73,7 @@ sub git_config_dump { my @cmd = (qw/git config/, "--file=$file", '-l'); my $cmd = join(' ', @cmd); my $pid = open(my $fh, '-|', @cmd); - defined $pid or die "$cmd failed: $!\n"; + defined $pid or die "$cmd failed: $!"; my %rv; foreach my $line (<$fh>) { chomp $line; @@ -90,8 +90,8 @@ sub git_config_dump { $rv{$k} = $v; } } - close $fh or die "failed to close ($cmd) pipe: $!\n"; - $? and warn "$$ $cmd exited with: ($pid) $?\n"; + close $fh or die "failed to close ($cmd) pipe: $!"; + $? and warn "$$ $cmd exited with: ($pid) $?"; \%rv; } -- cgit v1.2.3-24-ge0c7