diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2014-11-10 22:59:07 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-11-25 05:04:07 +0100 |
commit | 4d25dfd611e7786a17975fcaed039be971bac7da (patch) | |
tree | 93ff52102c48134f18290c2f1c7a383e9e469813 /lib/ldb/pyldb.c | |
parent | 18f879b857c174371a9fe27722c70051ed68ed64 (diff) | |
download | samba-4d25dfd611e7786a17975fcaed039be971bac7da.tar.gz samba-4d25dfd611e7786a17975fcaed039be971bac7da.tar.xz samba-4d25dfd611e7786a17975fcaed039be971bac7da.zip |
lib-pyldb: Throw exception when we can't create MessageElement object
At the moment we return an error, but no exception and it is
hard to instantly see what the problem is from Python
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/ldb/pyldb.c')
-rw-r--r-- | lib/ldb/pyldb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index efac7b1be6..40c802fd9a 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -2352,6 +2352,8 @@ static struct ldb_message_element *PyObject_AsMessageElement( (uint8_t *)PyString_AsString(obj), me->values[i].length+1); } } else { + PyErr_Format(PyExc_TypeError, + "String or List type expected for '%s' attribute", attr_name); talloc_free(me); me = NULL; } |