container: viewDB.withTxn: don't wrap errors

The withTxn function takes a custom function to execute; we should not
wrap those errors as the only responsibility of this function is to
execute the given function in a transaction.

This was introduced in 6549a270e9, and
an oversight of me.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-10-15 11:45:41 +02:00
parent 0d36ab1875
commit 0603bd9577

View File

@@ -152,7 +152,7 @@ func (db *ViewDB) withTxn(cb func(*memdb.Txn) error) error {
err := cb(txn)
if err != nil {
txn.Abort()
return errdefs.System(err)
return err
}
txn.Commit()
return nil