Skip to content

Commit

Permalink
Added parseDBError call for pgx.BeginTxFunc function call not to have…
Browse files Browse the repository at this point in the history
… storage raw error. (#30)

Added parseDBError call for pgx.BeginTxFunc function call not to have
storage raw error.
  • Loading branch information
ice-myles authored Jan 17, 2024
1 parent d8a17f1 commit 97c053b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connectors/storage/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func DoInTransaction(ctx context.Context, db *DB, fn func(conn QueryExecer) erro
txOptions := pgx.TxOptions{IsoLevel: pgx.Serializable, AccessMode: pgx.ReadWrite, DeferrableMode: pgx.NotDeferrable}
_, err := retry[any](ctx, func() (any, error) {
//nolint:wrapcheck // We have nothing relevant to wrap.
if err := pgx.BeginTxFunc(ctx, db.primary(), txOptions, func(tx pgx.Tx) error { return fn(tx) }); err != nil && IsUnexpected(err) {
if err := parseDBError(pgx.BeginTxFunc(ctx, db.primary(), txOptions, func(tx pgx.Tx) error { return fn(tx) })); err != nil && IsUnexpected(err) {
return nil, err
} else { //nolint:revive // Nope.
return nil, backoff.Permanent(err) //nolint:wrapcheck // Not needed.
Expand Down

0 comments on commit 97c053b

Please sign in to comment.