Merge pull request #1438 from NixOS/log-malformed-json

Log malformed JSON received from `nix-eval-jobs`
This commit is contained in:
Jörg Thalheim 2025-02-12 12:58:18 +07:00 committed by GitHub
commit c6f98202cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -416,11 +416,18 @@ sub evalJobs {
}
if (defined $out && $out ne '') {
my $job = decode_json($out);
my $job;
try {
$job = decode_json($out);
} catch {
warn "nix-eval-jobs sent invalid JSON.\n parse error: $_\n invalid json: $out\n";
};
undef $out;
if (defined $job) {
return $job;
}
}
}
};
}