summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-03-03 22:29:12 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-03-03 23:20:06 +0100
commit229935e03686ebdbd4f01cd2939e4399b68c33ec (patch)
tree7683cf5f93378f01a6358cd30895c966831da01c /lib
parentd460bab949ef48ca4e77864d624da5834dabd057 (diff)
downloadsamba-229935e03686ebdbd4f01cd2939e4399b68c33ec.tar.gz
samba-229935e03686ebdbd4f01cd2939e4399b68c33ec.tar.xz
samba-229935e03686ebdbd4f01cd2939e4399b68c33ec.zip
pyldb: Better error reporting
Provide more useful error messages for some type errors Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/pyldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 30cb836738..a3ffde92c6 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -1213,7 +1213,7 @@ static struct ldb_message *PyDict_AsMessage(TALLOC_CTX *mem_ctx,
msg_el = PyObject_AsMessageElement(msg->elements, value,
mod_flags, key_str);
if (msg_el == NULL) {
- PyErr_SetString(PyExc_TypeError, "unable to import element");
+ PyErr_Format(PyExc_TypeError, "unable to import element '%s'", key_str);
return NULL;
}
memcpy(&msg->elements[msg_pos], msg_el, sizeof(*msg_el));
@@ -2968,7 +2968,7 @@ static int py_ldb_msg_set_dn(PyLdbMessageObject *self, PyObject *value, void *cl
{
struct ldb_message *msg = pyldb_Message_AsMessage(self);
if (!pyldb_Dn_Check(value)) {
- PyErr_SetNone(PyExc_TypeError);
+ PyErr_SetString(PyExc_TypeError, "expected dn");
return -1;
}