chiark / gitweb /
dgit-repos-policy-debian: Better error handling
[dgit.git] / infra / dgit-repos-policy-debian
index fbf2d516219378ffd2caa86ff294f23c21acca32..d687a3e065501d3ffea00b238333ceb291e35133 100755 (executable)
@@ -356,15 +356,16 @@ 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>;
        # 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$/;
        printdebug "|< ", $_ if $debuglevel>=2;
 
        next if m/^\w+ missing$/;
-       die "$_ ?" unless m/^(\w+) (\w+) (\d+)\s/;
+       die "($taintid @objscatcmd) $_ ?" unless m/^(\w+) (\w+) (\d+)\s/;
        my ($objid,$objtype,$nbytes) = ($1,$2,$3);
 
        my $drop;
        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 =  ?
 
        $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();
         $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})
 
        my $timeshow = defined $ti->{time}
            ? " at time ".strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time})