Merge pull request #571 from kquick/moreinfo

Additional helpful information in error messages.
This commit is contained in:
Graham Christensen 2019-03-18 15:18:14 -05:00 committed by GitHub
commit 8a41ea5f60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -56,7 +56,7 @@ sub updateDeclarativeJobset {
$input->jobsetinputalts->create({altnr => 0, value => $data->{value}}); $input->jobsetinputalts->create({altnr => 0, value => $data->{value}});
} }
delete $declSpec->{"inputs"}; delete $declSpec->{"inputs"};
die "invalid keys in declarative specification file\n" if (%{$declSpec}); die "invalid keys ($declSpec) in declarative specification file\n" if (%{$declSpec});
}); });
}; };

View file

@ -425,7 +425,13 @@ sub run {
sub grab { sub grab {
my (%args) = @_; my (%args) = @_;
my $res = run(%args, grabStderr => 0); my $res = run(%args, grabStderr => 0);
die "command `@{$args{cmd}}' failed with exit status $res->{status}" if $res->{status}; if ($res->{status}) {
my $msgloc = "(in an indeterminate location)";
if (defined $args{dir}) {
$msgloc = "in $args{dir}";
}
die "command `@{$args{cmd}}' failed with exit status $res->{status} $msgloc";
}
return $res->{stdout}; return $res->{stdout};
} }