From 6f07b8a81e6867d712bd0a57f32ce9e0e9b8dccb Mon Sep 17 00:00:00 2001 From: Andrei Mihu Date: Sun, 19 Mar 2017 19:34:43 +0000 Subject: [PATCH] Correctly preserve error in group create rollbacks --- server/pipeline_group.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/pipeline_group.go b/server/pipeline_group.go index 45d4417518..737db15ad8 100644 --- a/server/pipeline_group.go +++ b/server/pipeline_group.go @@ -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\"") {