]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2051] Better error explanation
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 19 Jul 2012 10:53:35 +0000 (12:53 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 19 Jul 2012 10:53:35 +0000 (12:53 +0200)
When there's a JSON error, we raise an exception with better
explanation.

src/lib/python/isc/datasrc/configurableclientlist_python.cc

index 0817790e55b8ab30f6650ed2f83935173fded2f9..989b1ac6498a64b69c24d3d7652cce97795caa8d 100644 (file)
@@ -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);