svn commit: samba r16007 - in branches/SAMBA_4_0/source/lib/ldb/common: .

abartlet at samba.org abartlet at samba.org
Fri Jun 2 14:33:57 GMT 2006


Author: abartlet
Date: 2006-06-02 14:33:57 +0000 (Fri, 02 Jun 2006)
New Revision: 16007

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16007

Log:
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

Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-06-02 14:26:15 UTC (rev 16006)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-06-02 14:33:57 UTC (rev 16007)
@@ -265,7 +265,8 @@
 	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 @@
 		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;
 }
 



More information about the samba-cvs mailing list