Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKomarovCoder committed Nov 13, 2023
1 parent 3e85f12 commit 626dfa5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (r *transactionRep) CreateTransaction(ctx context.Context, transaction *mod
return uuid.Nil, fmt.Errorf("failed to start transaction: %w", err)
}
defer func() {
if err := tx.Rollback(ctx); err != nil {
if err != nil {
if err = tx.Rollback(ctx); err != nil {
r.logger.Fatal("Rollback transaction Error: %w", err)
}
Expand Down Expand Up @@ -202,7 +202,7 @@ func (r *transactionRep) UpdateTransaction(ctx context.Context, transaction *mod
}

defer func() {
if err := tx.Rollback(ctx); err != nil {
if err != nil {
if err = tx.Rollback(ctx); err != nil {
r.logger.Fatal("Rollback transaction Error: %w", err)
}
Expand Down Expand Up @@ -300,7 +300,7 @@ func (r *transactionRep) DeleteTransaction(ctx context.Context, transactionID uu
}

defer func() {
if err := tx.Rollback(ctx); err != nil {
if err != nil {
if err = tx.Rollback(ctx); err != nil {
r.logger.Fatal("Rollback transaction Error: %w", err)
}
Expand Down

0 comments on commit 626dfa5

Please sign in to comment.