lint: fix errcheck for txn.Rollback/Commit and insert in platform
Use lint.LogOnErrRollback for deferred Rollbacks in arcgis.go. Capture and check errors from txn.Commit and CommunicationLogEntryInsert.
This commit is contained in:
parent
4008b9aa25
commit
934fb03ca2
2 changed files with 10 additions and 6 deletions
|
|
@ -56,7 +56,12 @@ func communicationMark(ctx context.Context, user User, comm_id int32, status mod
|
|||
Type: log_type,
|
||||
User: &user_id,
|
||||
}
|
||||
querypublic.CommunicationLogEntryInsert(ctx, txn, log_entry)
|
||||
txn.Commit(ctx)
|
||||
_, err = querypublic.CommunicationLogEntryInsert(ctx, txn, log_entry)
|
||||
if err != nil {
|
||||
return fmt.Errorf("insert communication log entry: %w", err)
|
||||
}
|
||||
if err := txn.Commit(ctx); err != nil {
|
||||
return fmt.Errorf("commit: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue