1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

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>
This commit is contained in:
Kamen Mazdrashki 2014-11-10 22:59:07 +01:00 committed by Andrew Bartlett
parent 18f879b857
commit 4d25dfd611

View File

@ -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;
}