feat(identity): store users, email tokens, and sessions
This commit is contained in:
1 parent
15e2e50561
commit
e7d0d92ef9
30 files changed
+4792
-32
No files matched your search
@@ -66,6 +66,7 @@ func (transactor *Transactor) WithinTransaction(
|
||||
fnErr := fn(context.WithValue(ctx, transactionContextKey{}, true), &UnitOfWork{tx: tx, queries: sqlc.New(tx)})
|
||||
finished = true
|
||||
if fnErr != nil {
|
||||
fnErr = markTransactionConflict(fnErr)
|
||||
if rollbackErr := rollback(ctx, tx); rollbackErr != nil {
|
||||
return errors.Join(fnErr, fmt.Errorf("Transactor.WithinTransaction - roll back transaction: %w", rollbackErr))
|
||||
}
|
||||
@@ -75,7 +76,7 @@ func (transactor *Transactor) WithinTransaction(
|
||||
// pgx reports pgx.ErrTxCommitRollback when fn ignored a statement error
|
||||
// and PostgreSQL rolled the aborted transaction back instead. After a
|
||||
// network error the commit outcome is unknown; see outbound.Transactor.
|
||||
return fmt.Errorf("Transactor.WithinTransaction - commit transaction: %w", err)
|
||||
return fmt.Errorf("Transactor.WithinTransaction - commit transaction: %w", markTransactionConflict(err))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user