Skip to content

Commit

Permalink
Add better error message for create transaction error
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Nov 16, 2023
1 parent 30f488a commit 9c9e95e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/datastore/postgres/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ func createNewTransaction(ctx context.Context, tx pgx.Tx) (newXID xid8, newSnaps
ctx, span := tracer.Start(ctx, "createNewTransaction")
defer span.End()

err = tx.QueryRow(ctx, createTxn).Scan(&newXID, &newSnapshot)
cterr := tx.QueryRow(ctx, createTxn).Scan(&newXID, &newSnapshot)
if cterr != nil {
err = fmt.Errorf("error when trying to create a new transaction: %w", cterr)
}
return
}

Expand Down

0 comments on commit 9c9e95e

Please sign in to comment.