handleDeclarativeJobsetBuild: handle errors from readNixFile
This commit is contained in:
parent
eb5873ae53
commit
113a312f67
|
@ -68,8 +68,14 @@ sub handleDeclarativeJobsetBuild {
|
||||||
my $id = $build->id;
|
my $id = $build->id;
|
||||||
die "Declarative jobset build $id failed" unless $build->buildstatus == 0;
|
die "Declarative jobset build $id failed" unless $build->buildstatus == 0;
|
||||||
my $declPath = ($build->buildoutputs)[0]->path;
|
my $declPath = ($build->buildoutputs)[0]->path;
|
||||||
my $declText = readNixFile($declPath)
|
my $declText = eval {
|
||||||
or die "Couldn't read declarative specification file $declPath: $!";
|
readNixFile($declPath)
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
print STDERR "ERROR: failed to readNixFile $declPath: ", $@, "\n";
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
my $declSpec = decode_json($declText);
|
my $declSpec = decode_json($declText);
|
||||||
txn_do($db, sub {
|
txn_do($db, sub {
|
||||||
my @kept = keys %$declSpec;
|
my @kept = keys %$declSpec;
|
||||||
|
|
Loading…
Reference in a new issue