diff --git a/callbacks/transaction.go b/callbacks/transaction.go index 45c6ca11..8ba2ba3b 100644 --- a/callbacks/transaction.go +++ b/callbacks/transaction.go @@ -11,6 +11,8 @@ func BeginTransaction(db *gorm.DB) { db.InstanceSet("gorm:started_transaction", true) } else if tx.Error == gorm.ErrInvalidTransaction { tx.Error = nil + } else { + db.Error = tx.Error } } }