Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix rollback error log #459

Merged
merged 1 commit into from
Feb 1, 2023
Merged

Conversation

Code-Fight
Copy link
Contributor

What this PR does:
加上判断
Which issue(s) this PR fixes:
error日志重复打印

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@@ -174,7 +174,9 @@ func (c *ATConn) createNewTxOnExecIfNeed(ctx context.Context, f func() (types.Ex
log.Errorf("conn at rollback error:%v or recoverErr:%v", err, recoverErr)
if tx != nil {
rollbackErr := tx.Rollback()
log.Errorf("conn at rollback error:%v", rollbackErr)
if rollbackErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议写成这种形式

				if rollbackErr := tx.Rollback();rollbackErr != nil {
					log.Errorf("conn at rollback error:%v", rollbackErr)
				}

@106umao 106umao merged commit 9279392 into apache:master Feb 1, 2023
georgehao pushed a commit to georgehao/seata-go that referenced this pull request May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants