From 0603bd9577fa84b7554fcaf3fe04db0eb649973e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 15 Oct 2024 11:45:41 +0200 Subject: [PATCH] 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 6549a270e962dba0e24033367ec328b586444c92, and an oversight of me. Signed-off-by: Sebastiaan van Stijn --- container/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/view.go b/container/view.go index 0c6a5d4923..ded47d2a4c 100644 --- a/container/view.go +++ b/container/view.go @@ -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