Browse Source

[2051] Better error explanation

When there's a JSON error, we raise an exception with better
explanation.
Michal 'vorner' Vaner 12 years ago
parent
commit
057c023913
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/lib/python/isc/datasrc/configurableclientlist_python.cc

+ 5 - 0
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);