gnu: perl-archive-zip: Remove duplicate package definition.
[jackhill/guix/guix.git] / nix / nix-daemon / nix-daemon.cc
index 7d26b61..deb7003 100644 (file)
@@ -436,7 +436,15 @@ static void performOp(bool trusted, unsigned int clientVersion,
         bool sign = readInt(from) == 1;
         startWork();
         TunnelSink sink(to);
-        store->exportPath(path, sign, sink);
+       try {
+           store->exportPath(path, sign, sink);
+       }
+       catch (Error &e) {
+           /* Flush SINK beforehand or its destructor will rightfully trigger
+              an assertion failure.  */
+           sink.flush();
+           throw e;
+       }
         sink.flush();
         stopWork();
         writeInt(1, to);