Problem
In collectionDb.InsertOnConflictDoNothing, when GORM Create fails (tx.Error != nil), the code logged zap.Error(err) and returned err. The named return err is not assigned from the transaction in this path, so callers may receive nil or a stale value instead of the actual database error.
Expected
Log and return tx.Error (the GORM error from the failed Create).
Problem
In
collectionDb.InsertOnConflictDoNothing, when GORMCreatefails (tx.Error != nil), the code loggedzap.Error(err)and returnederr. The named returnerris not assigned from the transaction in this path, so callers may receivenilor a stale value instead of the actual database error.Expected
Log and return
tx.Error(the GORM error from the failedCreate).