about summary refs log tree commit diff
path: root/src/libstore/remote-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-03T02·22+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-03T02·22+0000
commit8c76df93e6fe021df6a6aa2b2c710202db326a34 (patch)
tree7921b521232fdbc2a8329995838b5b6b076822e0 /src/libstore/remote-store.cc
parent363f40022f08b3a7f5571574ddecf785db39584a (diff)
* Better error message if the worker doesn't start.
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r--src/libstore/remote-store.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 87547ce912..f724ac62f7 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -67,10 +67,14 @@ RemoteStore::RemoteStore()
 
     
     /* Send the magic greeting, check for the reply. */
-    writeInt(WORKER_MAGIC_1, to);
-    
-    unsigned int magic = readInt(from);
-    if (magic != WORKER_MAGIC_2) throw Error("protocol mismatch");
+    try {
+        writeInt(WORKER_MAGIC_1, to);
+        unsigned int magic = readInt(from);
+        if (magic != WORKER_MAGIC_2) throw Error("protocol mismatch");
+    } catch (Error & e) {
+        throw Error(format("cannot start worker process `%1%' (%2%)")
+            % worker % e.msg());
+    }
 }