summaryrefslogtreecommitdiff
path: root/ovsdb/transaction.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-03-09 12:41:37 -0800
committerBen Pfaff <blp@nicira.com>2011-03-10 11:23:59 -0800
commit1dd5b71d14b5c5360f97071041ec1bdd1f8d2445 (patch)
treef30031c2ba81acc9d48b880bdc965530cd493734 /ovsdb/transaction.c
parentd198c4beee03741670d046baf0179ac5583305bb (diff)
downloadopenvswitch-1dd5b71d14b5c5360f97071041ec1bdd1f8d2445.tar.gz
ovsdb: Improve error reporting for some internal errors.
Sometimes internal errors are generated based on an originating error. In these cases we were just throwing this information away. This commit adds this information to the internal error report so that the error will be easier to track down. I haven't actually seen a situation like this come up.
Diffstat (limited to 'ovsdb/transaction.c')
-rw-r--r--ovsdb/transaction.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c
index b26705a3a..b7c57e57e 100644
--- a/ovsdb/transaction.c
+++ b/ovsdb/transaction.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010 Nicira Networks
+/* Copyright (c) 2009, 2010, 2011 Nicira Networks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -218,8 +218,7 @@ update_row_ref_count(struct ovsdb_txn *txn, struct ovsdb_txn_row *r)
if (r->old) {
error = ovsdb_txn_adjust_row_refs(txn, r->old, column, -1);
if (error) {
- ovsdb_error_destroy(error);
- return OVSDB_BUG("error decreasing refcount");
+ return OVSDB_WRAP_BUG("error decreasing refcount", error);
}
}
if (r->new) {
@@ -476,8 +475,7 @@ ovsdb_txn_commit(struct ovsdb_txn *txn, bool durable)
* was really a no-op. */
error = for_each_txn_row(txn, determine_changes);
if (error) {
- ovsdb_error_destroy(error);
- return OVSDB_BUG("can't happen");
+ return OVSDB_WRAP_BUG("can't happen", error);
}
if (list_is_empty(&txn->txn_tables)) {
ovsdb_txn_abort(txn);