From d073c5f23ae6563a65af73fd6dc88886099011da Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Mon, 8 Nov 2010 23:50:23 +0200 Subject: [PATCH] s4-pydsdb: py_dsdb_load_partition_usn() - simplify error handling in and print on which partition error has occured --- source4/dsdb/pydsdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 41985ba648d..dbd38950225 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -483,8 +483,10 @@ static PyObject *py_dsdb_load_partition_usn(PyObject *self, PyObject *args) ret = dsdb_load_partition_usn(ldb, dn, &highest_uSN, &urgent_uSN); if (ret != LDB_SUCCESS) { - char *errstr = talloc_asprintf(mem_ctx, "Failed to load partition uSN - %s", ldb_errstring(ldb)); - PyErr_SetString(PyExc_RuntimeError, errstr); + PyErr_Format(PyExc_RuntimeError, + "Failed to load partition [%s] uSN - %s", + ldb_dn_get_linearized(dn), + ldb_errstring(ldb)); talloc_free(mem_ctx); return NULL; }