diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-06-04 19:45:12 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-07-16 16:47:46 +0100 |
commit | 86daff8924bab3297885cfe375341bf3f4ffe09c (patch) | |
tree | ea59d3444860e13f92f4bb0600619419583afb74 /infra | |
parent | 80480d4cf634ba08754576707630e127db38b69c (diff) |
dgit-repos-policy-debian: Better error handling
Show more info when git-cat-file --batch goes wrong
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/dgit-repos-policy-debian | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 7ad2c7d..d687a3e 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -356,7 +356,7 @@ END # This is not documented. I guess it might go away. So we # just read what we expect and then let it get SIGPIPE. $!=0; $_ = <CHKOUT>; - die "$? $!" unless defined $_; + die "($taintid @objscatcmd) $!" unless defined $_; printdebug "|< ", $_ if $debuglevel>=2; next if m/^\w+ missing$/; @@ -364,7 +364,8 @@ END my ($objid,$objtype,$nbytes) = ($1,$2,$3); my $drop; - (read CHKOUT, $drop, $nbytes) == $nbytes or die; + (read CHKOUT, $drop, $nbytes) == $nbytes + or die "($taintid @objscatcmd) $!"; $taintinfoq ||= $poldbh->prepare(<<END); SELECT package, time, comment FROM taints WHERE taint_id = ? @@ -372,7 +373,7 @@ END $taintinfoq->execute($taintid); my $ti = $taintinfoq->fetchrow_hashref(); - die unless $ti; + die "($taintid)" unless $ti; my $timeshow = defined $ti->{time} ? " at time ".strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time}) |