Skip to content

Commit

Permalink
[-] fix BeginTx() when returning error
Browse files Browse the repository at this point in the history
  • Loading branch information
pashagolub committed Sep 8, 2023
1 parent 7ccae6c commit 887bff8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pgxmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ func (c *pgxmock) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx,
if err != nil {
return nil, err
}
return c, ex.waitForDelay(ctx)
if err = ex.waitForDelay(ctx); err != nil {
return nil, err
}
return c, nil
}

func (c *pgxmock) Prepare(ctx context.Context, name, query string) (*pgconn.StatementDescription, error) {
Expand Down

0 comments on commit 887bff8

Please sign in to comment.