Browse Source

[1372] in get_journal_reader(), converted std::exception and other C++
exception to Python SystemError instead of datasrc.Error.

JINMEI Tatuya 13 years ago
parent
commit
d953caeeaf

+ 2 - 0
src/lib/python/isc/datasrc/client_inc.cc

@@ -232,6 +232,8 @@ isc.datasrc.NotImplemented.\n\
 Exceptions:\n\
   isc.datasrc.NotImplemented The data source does not support differences.\n\
   isc.datasrc.Error Other operational errors at the data source level.\n\
+  SystemError An unexpected error in the backend C++ code.  Either a rare\n\
+              system error such as short memory or an implementation bug.\n\
 \n\
 Parameters:\n\
   zone       The name of the zone for which the difference should be\n\

+ 2 - 3
src/lib/python/isc/datasrc/client_python.cc

@@ -203,10 +203,9 @@ DataSourceClient_getJournalReader(PyObject* po_self, PyObject* args) {
         } catch (const DataSourceError& ex) {
             PyErr_SetString(getDataSourceException("Error"), ex.what());
         } catch (const std::exception& ex) {
-            PyErr_SetString(getDataSourceException("Error"), ex.what());
+            PyErr_SetString(PyExc_SystemError, ex.what());
         } catch (...) {
-            PyErr_SetString(getDataSourceException("Error"),
-                            "Unexpected exception");
+            PyErr_SetString(PyExc_SystemError, "Unexpected exception");
         }
     }
     return (NULL);