From: Michal 'vorner' Vaner Date: Thu, 19 Jul 2012 10:53:35 +0000 (+0200) Subject: [2051] Better error explanation X-Git-Tag: trac2351_base~157^2~26^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=057c023913aa0101cb818b901be7e4eb29608d35;p=thirdparty%2Fkea.git [2051] Better error explanation When there's a JSON error, we raise an exception with better explanation. --- diff --git a/src/lib/python/isc/datasrc/configurableclientlist_python.cc b/src/lib/python/isc/datasrc/configurableclientlist_python.cc index 0817790e55..989b1ac649 100644 --- a/src/lib/python/isc/datasrc/configurableclientlist_python.cc +++ b/src/lib/python/isc/datasrc/configurableclientlist_python.cc @@ -100,6 +100,11 @@ ConfigurableClientList_configure(PyObject* po_self, PyObject* args) { } else { return (NULL); } + } catch (const isc::data::JSONError& jse) { + const string ex_what(std::string("JSON parse error in data source" + " configuration: ") + jse.what()); + PyErr_SetString(getDataSourceException("Error"), ex_what.c_str()); + return (NULL); } catch (const std::exception& exc) { PyErr_SetString(getDataSourceException("Error"), exc.what()); return (NULL);