2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

[#2960] removed useless try catch

This commit is contained in:
Razvan Becheriu 2024-05-23 13:46:46 +03:00
parent 66eacf5904
commit c2f9cc6051
3 changed files with 14 additions and 32 deletions

View File

@ -1929,7 +1929,7 @@ learn which scopes are available for the different HA modes of operation.
The :isccmd:`ha-scopes` command can put Kea servers into conflicting states, The :isccmd:`ha-scopes` command can put Kea servers into conflicting states,
which can lead to unexpected behavior. Changing scopes does not automatically which can lead to unexpected behavior. Changing scopes does not automatically
change the state of the server or its relationship with a partner. change the state of the server or its relationship with a partner.
For example, when we add primary scopes to the standby server it will start For example, when we add primary scopes to the standby server it will start
responding to DHCP traffic for those scopes. This can lead to a situation where responding to DHCP traffic for those scopes. This can lead to a situation where
both servers are responding to the same traffic, which can lead to IP address both servers are responding to the same traffic, which can lead to IP address
@ -2628,4 +2628,4 @@ branch ``server3``:
and ``reselect-subnet-pool`` parameters of the :ischooklib:`libdhcp_radius.so`. The High and ``reselect-subnet-pool`` parameters of the :ischooklib:`libdhcp_radius.so`. The High
Availability hook library uses an originally selected subnet for choosing an HA relationship Availability hook library uses an originally selected subnet for choosing an HA relationship
to process a packet. The subnet reselection may interfere with this choice. See the to process a packet. The subnet reselection may interfere with this choice. See the
:ref:`radius-config` for details. :ref:`radius-config` for details.

View File

@ -75,14 +75,11 @@ CtrlDhcp4Hooks Hooks;
/// ///
/// @param signo Signal number received. /// @param signo Signal number received.
void signalHandler(int signo) { void signalHandler(int signo) {
try { // SIGHUP signals a request to reconfigure the server.
// SIGHUP signals a request to reconfigure the server. if (signo == SIGHUP) {
if (signo == SIGHUP) { CommandMgr::instance().processCommand(createCommand("config-reload"));
CommandMgr::instance().processCommand(createCommand("config-reload")); } else if ((signo == SIGTERM) || (signo == SIGINT)) {
} else if ((signo == SIGTERM) || (signo == SIGINT)) { CommandMgr::instance().processCommand(createCommand("shutdown"));
CommandMgr::instance().processCommand(createCommand("shutdown"));
}
} catch (const isc::Exception& ex) {
} }
} }
@ -159,13 +156,7 @@ ControlledDhcpv4Srv::loadConfigFile(const std::string& file_name) {
} }
// Use parsed JSON structures to configure the server // Use parsed JSON structures to configure the server
try { result = CommandMgr::instance().processCommand(createCommand("config-set", json));
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
} catch (const isc::Exception& ex) {
result = isc::config::createAnswer(CONTROL_RESULT_ERROR, string("Error while processing command "
"'config-set': ") + ex.what() +
", params: '" + json->str() + "'");
}
if (!result) { if (!result) {
// Undetermined status of the configuration. This should never // Undetermined status of the configuration. This should never
// happen, but as the configureDhcp4Server returns a pointer, it is // happen, but as the configureDhcp4Server returns a pointer, it is

View File

@ -78,14 +78,11 @@ static const char* SERVER_DUID_FILE = "kea-dhcp6-serverid";
/// ///
/// @param signo Signal number received. /// @param signo Signal number received.
void signalHandler(int signo) { void signalHandler(int signo) {
try { // SIGHUP signals a request to reconfigure the server.
// SIGHUP signals a request to reconfigure the server. if (signo == SIGHUP) {
if (signo == SIGHUP) { CommandMgr::instance().processCommand(createCommand("config-reload"));
CommandMgr::instance().processCommand(createCommand("config-reload")); } else if ((signo == SIGTERM) || (signo == SIGINT)) {
} else if ((signo == SIGTERM) || (signo == SIGINT)) { CommandMgr::instance().processCommand(createCommand("shutdown"));
CommandMgr::instance().processCommand(createCommand("shutdown"));
}
} catch (const isc::Exception& ex) {
} }
} }
@ -162,13 +159,7 @@ ControlledDhcpv6Srv::loadConfigFile(const std::string& file_name) {
} }
// Use parsed JSON structures to configure the server // Use parsed JSON structures to configure the server
try { result = CommandMgr::instance().processCommand(createCommand("config-set", json));
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
} catch (const isc::Exception& ex) {
result = isc::config::createAnswer(CONTROL_RESULT_ERROR, string("Error while processing command "
"'config-set': ") + ex.what() +
", params: '" + json->str() + "'");
}
if (!result) { if (!result) {
// Undetermined status of the configuration. This should never // Undetermined status of the configuration. This should never
// happen, but as the configureDhcp6Server returns a pointer, it is // happen, but as the configureDhcp6Server returns a pointer, it is