git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51101b3
)
pydsdb: Raise a more useful exception when dsdb_wellknown_dn fails.
author
Andrew Bartlett
<abartlet@samba.org>
Mon, 23 Sep 2013 02:26:10 +0000
(19:26 -0700)
committer
Michael Adam
<obnox@samba.org>
Tue, 24 Sep 2013 05:44:29 +0000
(07:44 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source4/dsdb/pydsdb.c
patch
|
blob
|
history
diff --git
a/source4/dsdb/pydsdb.c
b/source4/dsdb/pydsdb.c
index 793c49522b01c0526f217a0516f064d4f543295e..ee02483acd4387806a847bb1363a8b4f2b64162b 100644
(file)
--- a/
source4/dsdb/pydsdb.c
+++ b/
source4/dsdb/pydsdb.c
@@
-981,6
+981,11
@@
static PyObject *py_dsdb_get_wellknown_dn(PyObject *self, PyObject *args)
PyErr_LDB_DN_OR_RAISE(py_nc_dn, nc_dn);
ret = dsdb_wellknown_dn(ldb, ldb, nc_dn, wkguid, &wk_dn);
+ if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ PyErr_Format(PyExc_KeyError, "Failed to find well known DN for GUID %s", wkguid);
+ return NULL;
+ }
+
PyErr_LDB_ERROR_IS_ERR_RAISE(py_ldb_get_exception(), ret, ldb);
py_wk_dn = pyldb_Dn_FromDn(wk_dn);