From: Francis Dupont Date: Sat, 22 Sep 2018 14:01:09 +0000 (+0200) Subject: [65-libyang-control-socket] Added Unexpected for impossible conditions and @throw... X-Git-Tag: 165-netbsd-8-fixes_base^2~3^2^2~1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=117e9e7864eb141578a615e21352e50f91b6606d;p=thirdparty%2Fkea.git [65-libyang-control-socket] Added Unexpected for impossible conditions and @throw for BadValue --- diff --git a/src/lib/yang/translator_control_socket.cc b/src/lib/yang/translator_control_socket.cc index 84f4bfb7b7..ad5d0866c7 100644 --- a/src/lib/yang/translator_control_socket.cc +++ b/src/lib/yang/translator_control_socket.cc @@ -55,7 +55,8 @@ TranslatorControlSocket::getControlSocketKea(const string& xpath) { } return (result); } - return (ElementPtr()); + isc_throw(Unexpected, "getControlSocketKea rquires name and type: " + << xpath); } void diff --git a/src/lib/yang/translator_control_socket.h b/src/lib/yang/translator_control_socket.h index 50c43662f8..2ae6bb266f 100644 --- a/src/lib/yang/translator_control_socket.h +++ b/src/lib/yang/translator_control_socket.h @@ -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);