]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-control-socket] Added Unexpected for impossible conditions and @throw...
authorFrancis Dupont <fdupont@isc.org>
Sat, 22 Sep 2018 14:01:09 +0000 (16:01 +0200)
committerFrancis Dupont <fdupont@isc.org>
Sat, 22 Sep 2018 14:01:09 +0000 (16:01 +0200)
src/lib/yang/translator_control_socket.cc
src/lib/yang/translator_control_socket.h

index 84f4bfb7b7e32e7fec1807a0af3686000646c3da..ad5d0866c78354ad701a4bc60601af00bece6526 100644 (file)
@@ -55,7 +55,8 @@ TranslatorControlSocket::getControlSocketKea(const string& xpath) {
         }
         return (result);
     }
-    return (ElementPtr());
+    isc_throw(Unexpected, "getControlSocketKea rquires name and type: "
+              << xpath);
 }
 
 void
index 50c43662f8c5f5bd4ff96c081cee19e9c72cb8c8..2ae6bb266f5a5dccdc35a47a75b4bf429d0f9356 100644 (file)
@@ -78,6 +78,7 @@ protected:
     ///
     /// @param xpath The xpath of the control socket.
     /// @param elem The JSON element.
+    /// @throw BadValue on control socket without socket type or name.
     void setControlSocketKea(const std::string& xpath,
                              isc::data::ConstElementPtr elem);