Skip to content

Commit c2f9cc6

Browse files
author
Razvan Becheriu
committed
[#2960] removed useless try catch
1 parent 66eacf5 commit c2f9cc6

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

doc/sphinx/arm/hooks-ha.rst

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

src/bin/dhcp4/ctrl_dhcp4_srv.cc

+6-15
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,11 @@ CtrlDhcp4Hooks Hooks;
7575
///
7676
/// @param signo Signal number received.
7777
void signalHandler(int signo) {
78-
try {
79-
// SIGHUP signals a request to reconfigure the server.
80-
if (signo == SIGHUP) {
81-
CommandMgr::instance().processCommand(createCommand("config-reload"));
82-
} else if ((signo == SIGTERM) || (signo == SIGINT)) {
83-
CommandMgr::instance().processCommand(createCommand("shutdown"));
84-
}
85-
} catch (const isc::Exception& ex) {
78+
// SIGHUP signals a request to reconfigure the server.
79+
if (signo == SIGHUP) {
80+
CommandMgr::instance().processCommand(createCommand("config-reload"));
81+
} else if ((signo == SIGTERM) || (signo == SIGINT)) {
82+
CommandMgr::instance().processCommand(createCommand("shutdown"));
8683
}
8784
}
8885

@@ -159,13 +156,7 @@ ControlledDhcpv4Srv::loadConfigFile(const std::string& file_name) {
159156
}
160157

161158
// Use parsed JSON structures to configure the server
162-
try {
163-
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
164-
} catch (const isc::Exception& ex) {
165-
result = isc::config::createAnswer(CONTROL_RESULT_ERROR, string("Error while processing command "
166-
"'config-set': ") + ex.what() +
167-
", params: '" + json->str() + "'");
168-
}
159+
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
169160
if (!result) {
170161
// Undetermined status of the configuration. This should never
171162
// happen, but as the configureDhcp4Server returns a pointer, it is

src/bin/dhcp6/ctrl_dhcp6_srv.cc

+6-15
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,11 @@ static const char* SERVER_DUID_FILE = "kea-dhcp6-serverid";
7878
///
7979
/// @param signo Signal number received.
8080
void signalHandler(int signo) {
81-
try {
82-
// SIGHUP signals a request to reconfigure the server.
83-
if (signo == SIGHUP) {
84-
CommandMgr::instance().processCommand(createCommand("config-reload"));
85-
} else if ((signo == SIGTERM) || (signo == SIGINT)) {
86-
CommandMgr::instance().processCommand(createCommand("shutdown"));
87-
}
88-
} catch (const isc::Exception& ex) {
81+
// SIGHUP signals a request to reconfigure the server.
82+
if (signo == SIGHUP) {
83+
CommandMgr::instance().processCommand(createCommand("config-reload"));
84+
} else if ((signo == SIGTERM) || (signo == SIGINT)) {
85+
CommandMgr::instance().processCommand(createCommand("shutdown"));
8986
}
9087
}
9188

@@ -162,13 +159,7 @@ ControlledDhcpv6Srv::loadConfigFile(const std::string& file_name) {
162159
}
163160

164161
// Use parsed JSON structures to configure the server
165-
try {
166-
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
167-
} catch (const isc::Exception& ex) {
168-
result = isc::config::createAnswer(CONTROL_RESULT_ERROR, string("Error while processing command "
169-
"'config-set': ") + ex.what() +
170-
", params: '" + json->str() + "'");
171-
}
162+
result = CommandMgr::instance().processCommand(createCommand("config-set", json));
172163
if (!result) {
173164
// Undetermined status of the configuration. This should never
174165
// happen, but as the configureDhcp6Server returns a pointer, it is

0 commit comments

Comments
 (0)