second error variable name to avoid confusing they yushie.

This commit is contained in:
vyzo 2023-03-16 17:42:09 +02:00
parent 1e7f5c6a1e
commit 9c087cc52c

View File

@ -341,8 +341,8 @@ func (x *msgIndex) processHeadChanges(ctx context.Context) error {
for _, hc := range pend {
for _, ts := range hc.rev {
if err := x.doRevert(ctx, tx, ts); err != nil {
if err := tx.Rollback(); err != nil {
log.Errorf("error rolling back transaction: %s", err)
if err2 := tx.Rollback(); err2 != nil {
log.Errorf("error rolling back transaction: %s", err2)
}
return xerrors.Errorf("error reverting %s: %w", ts, err)
}
@ -350,8 +350,8 @@ func (x *msgIndex) processHeadChanges(ctx context.Context) error {
for _, ts := range hc.app {
if err := x.doApply(ctx, tx, ts); err != nil {
if err := tx.Rollback(); err != nil {
log.Errorf("error rolling back transaction: %s", err)
if err2 := tx.Rollback(); err2 != nil {
log.Errorf("error rolling back transaction: %s", err2)
}
return xerrors.Errorf("error applying %s: %w", ts, err)
}