Skip to content

Commit

Permalink
Correctly preserve error in group create rollbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
zyro committed Mar 19, 2017
1 parent a3f6988 commit 6f07b8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/pipeline_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ func (p *pipeline) groupCreate(logger zap.Logger, session *session, envelope *En
if err != nil {
logger.Error("Could not create group", zap.Error(err))
if tx != nil {
err = tx.Rollback()
if err != nil {
logger.Error("Could not rollback transaction", zap.Error(err))
txErr := tx.Rollback()
if txErr != nil {
logger.Error("Could not rollback transaction", zap.Error(txErr))
}
}
if strings.HasSuffix(err.Error(), "violates unique constraint \"groups_name_key\"") {
Expand Down

0 comments on commit 6f07b8a

Please sign in to comment.