diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-03-21T18·23+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-03-21T18·23+0100 |
commit | 895a74a814cd67cd2e13d0621603583a2d15b159 (patch) | |
tree | 200ff43144d85b851c69d641a363639ffc8bfa37 /src/libstore | |
parent | ed5c0f69f28732879a7aac2d67367446f6d3152d (diff) |
LocalFSStore::getBuildLog(): Handle corrupted logs
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/local-fs-store.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc index 002ee4a65ce2..57e1b8a09fe6 100644 --- a/src/libstore/local-fs-store.cc +++ b/src/libstore/local-fs-store.cc @@ -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; |