summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configd/src/apps/cmd/main.cpp10
-rw-r--r--searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp9
2 files changed, 14 insertions, 5 deletions
diff --git a/configd/src/apps/cmd/main.cpp b/configd/src/apps/cmd/main.cpp
index 53edaf80dba..49767ab47aa 100644
--- a/configd/src/apps/cmd/main.cpp
+++ b/configd/src/apps/cmd/main.cpp
@@ -4,6 +4,7 @@
#include <unistd.h>
#include <vespa/vespalib/util/signalhandler.h>
+#include <vespa/vespalib/util/exception.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/frt/target.h>
#include <vespa/fnet/frt/rpcrequest.h>
@@ -64,8 +65,13 @@ int
Cmd::run(const char *cmd, const char *arg)
{
int retval = 0;
- initRPC("tcp/localhost:19097");
-
+ try {
+ initRPC("tcp/localhost:19097");
+ } catch (vespalib::Exception &e) {
+ fprintf(stderr, "vespa-sentinel-cmd: exception in network initialization: %s\n",
+ e.what());
+ return 2;
+ }
FRT_RPCRequest *req = _server->supervisor().AllocRPCRequest();
req->SetMethodName(cmd);
diff --git a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp
index 2e097e7141f..3b3b5f412d2 100644
--- a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp
+++ b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp
@@ -216,9 +216,12 @@ public:
fprintf(stderr, "Config system is not up. Verify that vespa is started.");
return 3;
}
-
- initRPC();
-
+ try {
+ initRPC();
+ } catch (vespalib::Exception &e) {
+ fprintf(stderr, "Exception in network initialization: %s", e.what());
+ return 2;
+ }
int port = 0;
std::string spec = _argv[1];