1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 19:57:59 +02:00

LocalFSStore::getBuildLog(): Handle corrupted logs

This commit is contained in:
Eelco Dolstra 2017-03-21 19:23:07 +01:00
parent ed5c0f69f2
commit 895a74a814
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 21 additions and 14 deletions

View file

@ -94,6 +94,7 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path & path_)
assertStorePath(path);
if (!isDerivation(path)) {
try {
path = queryPathInfo(path)->deriver;
@ -116,8 +117,12 @@ std::shared_ptr<std::string> LocalFSStore::getBuildLog(const Path & path_)
if (pathExists(logPath))
return std::make_shared<std::string>(readFile(logPath));
else if (pathExists(logBz2Path))
return decompress("bzip2", readFile(logBz2Path));
else if (pathExists(logBz2Path)) {
try {
return decompress("bzip2", readFile(logBz2Path));
} catch (Error &) { }
}
}
return nullptr;