]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2960] removed useless try catch
authorRazvan Becheriu <razvan@isc.org>
Thu, 23 May 2024 10:46:46 +0000 (13:46 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 23 May 2024 14:08:44 +0000 (17:08 +0300)
doc/sphinx/arm/hooks-ha.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc

index 154d688413b7f933288f11d947ec470b416fdaf4..c39ab35d3a82b6f55963e27411214853670a43f0 100644 (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,
    which can lead to unexpected behavior. Changing scopes does not automatically
    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
    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
@@ -2628,4 +2628,4 @@ branch ``server3``:
     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
     to process a packet. The subnet reselection may interfere with this choice. See the
-    :ref:`radius-config` for details.
\ No newline at end of file
+    :ref:`radius-config` for details.
index fb3565efa29226fb35b879f0be8b3e902be63cc5..d0483a3584a2e13a11e3cb27a61c68728b1ef5e5 100644 (file)
@@ -75,14 +75,11 @@ CtrlDhcp4Hooks Hooks;
 ///
 /// @param signo Signal number received.
 void signalHandler(int signo) {
-    try {
-        // SIGHUP signals a request to reconfigure the server.
-        if (signo == SIGHUP) {
-            CommandMgr::instance().processCommand(createCommand("config-reload"));
-        } else if ((signo == SIGTERM) || (signo == SIGINT)) {
-            CommandMgr::instance().processCommand(createCommand("shutdown"));
-        }
-    } catch (const isc::Exception& ex) {
+    // SIGHUP signals a request to reconfigure the server.
+    if (signo == SIGHUP) {
+        CommandMgr::instance().processCommand(createCommand("config-reload"));
+    } else if ((signo == SIGTERM) || (signo == SIGINT)) {
+        CommandMgr::instance().processCommand(createCommand("shutdown"));
     }
 }
 
@@ -159,13 +156,7 @@ ControlledDhcpv4Srv::loadConfigFile(const std::string& file_name) {
         }
 
         // Use parsed JSON structures to configure the server
-        try {
-            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() + "'");
-        }
+        result = CommandMgr::instance().processCommand(createCommand("config-set", json));
         if (!result) {
             // Undetermined status of the configuration. This should never
             // happen, but as the configureDhcp4Server returns a pointer, it is
index 6f7ef120564a4482804768472aebbac9d9a3f41f..457eeb46a1cb78469eef708851cfa4b6d3eb7506 100644 (file)
@@ -78,14 +78,11 @@ static const char* SERVER_DUID_FILE = "kea-dhcp6-serverid";
 ///
 /// @param signo Signal number received.
 void signalHandler(int signo) {
-    try {
-        // SIGHUP signals a request to reconfigure the server.
-        if (signo == SIGHUP) {
-            CommandMgr::instance().processCommand(createCommand("config-reload"));
-        } else if ((signo == SIGTERM) || (signo == SIGINT)) {
-            CommandMgr::instance().processCommand(createCommand("shutdown"));
-        }
-    } catch (const isc::Exception& ex) {
+    // SIGHUP signals a request to reconfigure the server.
+    if (signo == SIGHUP) {
+        CommandMgr::instance().processCommand(createCommand("config-reload"));
+    } else if ((signo == SIGTERM) || (signo == SIGINT)) {
+        CommandMgr::instance().processCommand(createCommand("shutdown"));
     }
 }
 
@@ -162,13 +159,7 @@ ControlledDhcpv6Srv::loadConfigFile(const std::string& file_name) {
         }
 
         // Use parsed JSON structures to configure the server
-        try {
-            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() + "'");
-        }
+        result = CommandMgr::instance().processCommand(createCommand("config-set", json));
         if (!result) {
             // Undetermined status of the configuration. This should never
             // happen, but as the configureDhcp6Server returns a pointer, it is