Adding details to the DB commit () release_asserts

This commit is contained in:
Thiago Silva 2022-04-11 11:03:45 -03:00 committed by Thiago Silva
commit cf5a088861
2 changed files with 9 additions and 3 deletions

View file

@ -99,8 +99,11 @@ void nano::write_mdb_txn::commit ()
{ {
if (active) if (active)
{ {
auto status (mdb_txn_commit (handle)); auto status = mdb_txn_commit (handle);
release_assert (status == MDB_SUCCESS, mdb_strerror (status)); if (status != MDB_SUCCESS)
{
release_assert (false && "Unable to write to the LMDB database", mdb_strerror (status));
}
txn_callbacks.txn_end (this); txn_callbacks.txn_end (this);
active = false; active = false;
} }

View file

@ -66,7 +66,10 @@ void nano::write_rocksdb_txn::commit ()
++attempt_num; ++attempt_num;
} }
release_assert (status.ok (), status.ToString ()); if (!status.ok ())
{
release_assert (false && "Unable to write to the RocksDB database", status.ToString ());
}
active = false; active = false;
} }
} }