// Launch the controller passing in command line arguments.
// Exit program with the controller's return code.
- try {
+ try {
// Instantiate/fetch the application controller singleton.
DControllerBasePtr& controller = CtrlAgentController::instance();
} catch (const std::exception& ex) {
std::cerr << "Service failed: " << ex.what() << std::endl;
ret = EXIT_FAILURE;
+ } catch (...) {
+ std::cerr << "Service failed: Unknown error" << std::endl;
+ ret = EXIT_FAILURE;
}
return (ret);
// Launch the controller passing in command line arguments.
// Exit program with the controller's return code.
- try {
+ try {
// Instantiate/fetch the DHCP-DDNS application controller singleton.
DControllerBasePtr& controller = D2Controller::instance();
} catch (const std::exception& ex) {
std::cerr << "Service failed: " << ex.what() << std::endl;
ret = EXIT_FAILURE;
+ } catch (...) {
+ std::cerr << "Service failed: Unknown error" << std::endl;
+ ret = EXIT_FAILURE;
}
return (ret);
// Already logged so ignore
}
ret = EXIT_FAILURE;
+ } catch (...) {
+ cerr << DHCP4_NAME << ": Fatal error during start up: Unknown error"
+ << endl;
+ ret = EXIT_FAILURE;
}
return (ret);
// Already logged so ignore
}
ret = EXIT_FAILURE;
+ } catch (...) {
+ cerr << DHCP6_NAME << ": Fatal error during start up: Unknown error"
+ << endl;
+ ret = EXIT_FAILURE;
}
return (ret);
} catch (const boost::exception& ex) {
std::cerr << boost::diagnostic_information(ex) << std::endl;
ret = EXIT_FAILURE;
-
} catch (const std::exception& ex) {
std::cerr << "Service failed: " << ex.what() << std::endl;
ret = EXIT_FAILURE;
+ } catch (...) {
+ std::cerr << "Service failed: Unknown error" << std::endl;
+ ret = EXIT_FAILURE;
}
return (ret);
} catch (const std::exception& ex) {
std::cerr << "Service failed: " << ex.what() << std::endl;
ret = EXIT_FAILURE;
+ } catch (...) {
+ std::cerr << "Service failed: Unknown error" << std::endl;
+ ret = EXIT_FAILURE;
}
return (ret);
main(int argc, char* argv[]) {
int ret_code = 0;
std::string diags;
- bool parsed = false;
+ bool parser_error = true;
try {
CommandOptions command_options;
diags = command_options.getDiags();
if (command_options.parse(argc, argv, true)) {
return (ret_code);
}
-
- parsed = true;
-
+ parser_error = false;
auto scenario = command_options.getScenario();
PerfSocket socket(command_options);
if (scenario == Scenario::BASIC) {
}
} catch (const std::exception& e) {
ret_code = 1;
- if (parsed) {
+ if (!parser_error) {
std::cerr << std::endl << "ERROR: running perfdhcp: "
<< e.what() << std::endl;
} else {
if (diags.find('e') != std::string::npos) {
std::cerr << "Fatal error" << std::endl;
}
+ } catch (...) {
+ ret_code = 1;
+ if (!parser_error) {
+ std::cerr << std::endl << "ERROR: running perfdhcp: Unknown error"
+ << std::endl;
+ } else {
+ CommandOptions::usage();
+ std::cerr << std::endl << "ERROR: parsing command line options: Unknown error"
+ << std::endl;
+ }
+ if (diags.find('e') != std::string::npos) {
+ std::cerr << "Fatal error" << std::endl;
+ }
}
return (ret_code);
}
}
}
- cerr << text << std::endl;
+ cerr << text << "\n";
return (1);
} catch (const std::exception& ex) {
- std::cerr << "Fatal error: " << ex.what() << std::endl;
+ cerr << "Fatal error: " << ex.what() << "\n";
+
+ return (1);
+ } catch (...) {
+ cerr << "Fatal error: Unknown error\n";
return (1);
}