about summary refs log tree commit diff
path: root/src/libstore/remote-fs-accessor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/remote-fs-accessor.cc')
-rw-r--r--src/libstore/remote-fs-accessor.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/remote-fs-accessor.cc b/src/libstore/remote-fs-accessor.cc
index 9396912046..ba9620a175 100644
--- a/src/libstore/remote-fs-accessor.cc
+++ b/src/libstore/remote-fs-accessor.cc
@@ -19,9 +19,13 @@ Path RemoteFSAccessor::makeCacheFile(const Path & storePath)
 
 void RemoteFSAccessor::addToCache(const Path & storePath, const std::string & nar)
 {
-    if (cacheDir != "")
+    try {
+        if (cacheDir == "") return;
         /* FIXME: do this asynchronously. */
         writeFile(makeCacheFile(storePath), nar);
+    } catch (...) {
+        ignoreException();
+    }
 }
 
 std::pair<ref<FSAccessor>, Path> RemoteFSAccessor::fetch(const Path & path_)