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()); + } }