chiark / gitweb /
dgit-repos-policy-debian: Fix error handling, and test fixes
[dgit.git] / infra / dgit-repos-policy-debian
index b631d07e8169a4ef65455f41530e77b1ea5f7623..ac427127464f4c932baa460a9e8ad170626d552f 100755 (executable)
@@ -88,7 +88,7 @@ sub apiquery ($) {
     $cmd .= " archive-api-query $subpath";
     printdebug "apiquery $cmd\n";
     $!=0; $?=0; my $json = `$cmd`;
-    defined $json or die "$subpath $! $?";
+    defined $json && !$? or die "$subpath $! $?";
     my $r = decode_json $json;
     my $d = new Data::Dumper([$r], [qw(r)]);
     printdebug "apiquery $subpath | ", $d->Dump() if $debuglevel>=2;