Print error strings when transactions fail in ldb tools
[kai/samba.git] / source4 / lib / ldb / tools / ldbedit.c
index b18aea1b10ca3e02db4a9ff1bcfbf4bb92375d5e..1a684c5c2db4d0c035efd6ffa33d0aaaa536288c 100644 (file)
@@ -113,7 +113,7 @@ static int merge_edits(struct ldb_context *ldb,
        int adds=0, modifies=0, deletes=0;
 
        if (ldb_transaction_start(ldb) != 0) {
-               fprintf(stderr, "Failed to start transaction\n");
+               fprintf(stderr, "Failed to start transaction: %s\n", ldb_errstring(ldb));
                return -1;
        }
 
@@ -156,7 +156,7 @@ static int merge_edits(struct ldb_context *ldb,
        }
 
        if (ldb_transaction_commit(ldb) != 0) {
-               fprintf(stderr, "Failed to commit transaction\n");
+               fprintf(stderr, "Failed to commit transaction: %s\n", ldb_errstring(ldb));
                return -1;
        }