diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-11-01 16:09:20 +1300 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2016-11-04 04:41:19 +0100 |
commit | e51256c7d58040eeee02fc189b55afbc58379f81 (patch) | |
tree | 7692ef92619675c912d78a45cc743bd1f348f7cf | |
parent | e737171f6ef172de559b41d54989eca0d7663b4e (diff) | |
download | samba-e51256c7d58040eeee02fc189b55afbc58379f81.tar.gz |
python: Add DsExtendedError Exception
This will be used for checking errors during a GetNCChanges EXOP like
RID Set allocation.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398
-rw-r--r-- | python/pyglue.c | 8 | ||||
-rw-r--r-- | python/samba/__init__.py | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/python/pyglue.c b/python/pyglue.c index 938a9f0ecf4..dbe7eb4ec69 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -27,6 +27,7 @@ void init_glue(void); static PyObject *PyExc_NTSTATUSError; static PyObject *PyExc_WERRORError; static PyObject *PyExc_HRESULTError; +static PyObject *PyExc_DsExtendedError; static PyObject *py_generate_random_str(PyObject *self, PyObject *args) { @@ -314,5 +315,12 @@ void init_glue(void) Py_INCREF(PyExc_HRESULTError); PyModule_AddObject(m, "HRESULTError", PyExc_HRESULTError); } + + PyExc_DsExtendedError = PyErr_NewException(discard_const_p(char, "samba.DsExtendedError"), PyExc_RuntimeError, NULL); + if (PyExc_DsExtendedError != NULL) { + Py_INCREF(PyExc_DsExtendedError); + PyModule_AddObject(m, "DsExtendedError", PyExc_DsExtendedError); + } + } diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 8c75a48874b..5f915318093 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -403,3 +403,4 @@ is_ntvfs_fileserver_built = _glue.is_ntvfs_fileserver_built NTSTATUSError = _glue.NTSTATUSError HRESULTError = _glue.HRESULTError WERRORError = _glue.WERRORError +DsExtendedError = _glue.DsExtendedError |