Catch ZKOperationTimeoutException and exit controlled
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <iostream>
-#include <string>
-#include <cstdlib>
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root
#include <boost/program_options.hpp>
#include <vespa/filedistribution/rpc/filedistributorrpc.h>
#include <vespa/filedistribution/common/exception.h>
#include <vespa/filedistribution/common/componentsdeleter.h>
+#include <iostream>
namespace {
const char* programName = "filedistributor";
@@ -310,6 +307,9 @@ FileDistributorApplication::Main() {
} catch (const config::InvalidConfigException & e) {
EV_STOPPING(programName, e.what());
return 8;
+ } catch (const ZKOperationTimeoutException & e) {
+ EV_STOPPING(programName, e.what());
+ return 9;
} catch (const ZKGenericException & e) {
EV_STOPPING(programName, e.what());
return 99;
@@ -330,9 +330,7 @@ executeApplication(int argc, char** argv) {
try {
po::variables_map values;
- po::store(
- po::parse_command_line(argc, argv, description),
- values);
+ po::store(po::parse_command_line(argc, argv, description), values);
if (exists(help, values)) {
std::cout <<description;
@@ -340,8 +338,7 @@ executeApplication(int argc, char** argv) {
}
ensureExists(configId, values);
- FileDistributorApplication application(
- values[configId].as<std::string > ());
+ FileDistributorApplication application(values[configId].as<std::string > ());
return application.Entry(argc, argv);
} catch(ProgramOptionException& e) {
