diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-06-02 14:33:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:08:49 -0500 |
commit | e3482ffeed80c156ce3832609515e3aea4ba907f (patch) | |
tree | d6c3be7a14ab0ebc64a8c050f797acc3ecd38bf6 /source4/lib/ldb | |
parent | 9a9a99b90a086af0ec67a46932c0b2322e716cea (diff) | |
download | samba-e3482ffeed80c156ce3832609515e3aea4ba907f.tar.gz samba-e3482ffeed80c156ce3832609515e3aea4ba907f.tar.bz2 samba-e3482ffeed80c156ce3832609515e3aea4ba907f.zip |
r16007: If no error string was setup by the backend, ensure that we always get
at least a generic error, even when inside a transaction.
This helps debugging ldb/js interactions a lot...
Andrew Bartlett
(This used to be commit b607acf6f0b3567a40a3e35911c690feda243f50)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index 53b4e51ff3..126ad37d9b 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -265,7 +265,8 @@ static int ldb_op_finish(struct ldb_context *ldb, int status) if (ldb->err_string == NULL) { /* no error string was setup by the backend */ ldb_set_errstring(ldb, - talloc_asprintf(ldb, "ldb error %d", status)); + talloc_asprintf(ldb, "%s (%d)", + ldb_strerror(status), status)); } ldb_transaction_cancel(ldb); return status; @@ -463,6 +464,13 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque return ldb_op_finish(ldb, ret); } + if (ldb->err_string == NULL) { + /* no error string was setup by the backend */ + ldb_set_errstring(ldb, + talloc_asprintf(ldb, "%s (%d)", + ldb_strerror(ret), ret)); + } + return ret; } |