about summary refs log tree commit diff
path: root/src/libstore/binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-06-05T14·04+0200
committerEelco Dolstra <edolstra@gmail.com>2018-06-05T14·04+0200
commit4ac4f675df3da01b6d814cd328dd3219dd472ac9 (patch)
treebfedf55a309956d4f7d5247be9d619c19b2717bd /src/libstore/binary-cache-store.cc
parent691b7582c76e05774548e84aba92ff0eb19b2589 (diff)
Don't require --fallback to recover from disappeared binary cache NARs
Diffstat (limited to 'src/libstore/binary-cache-store.cc')
-rw-r--r--src/libstore/binary-cache-store.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 11fa3cae27a5..76c0a1a891b8 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -218,7 +218,11 @@ void BinaryCacheStore::narFromPath(const Path & storePath, Sink & sink)
     auto info = queryPathInfo(storePath).cast<const NarInfo>();
 
     auto source = sinkToSource([this, url{info->url}](Sink & sink) {
-        getFile(url, sink);
+        try {
+            getFile(url, sink);
+        } catch (NoSuchBinaryCacheFile & e) {
+            throw SubstituteGone(e.what());
+        }
     });
 
     stats.narRead++;