From 0b876866208ece75b918eae9084d4271b6a056b4 Mon Sep 17 00:00:00 2001 From: JeffMboya Date: Fri, 26 Apr 2024 14:33:57 +0300 Subject: [PATCH] Consume ThingConnect in bootstrap Signed-off-by: JeffMboya --- bootstrap/postgres/configs.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap/postgres/configs.go b/bootstrap/postgres/configs.go index 6e23e39a302..efc2b9aa126 100644 --- a/bootstrap/postgres/configs.go +++ b/bootstrap/postgres/configs.go @@ -60,15 +60,13 @@ func (cr configRepository) Save(ctx context.Context, cfg bootstrap.Config, chsCo dbcfg := toDBConfig(cfg) if _, err := tx.NamedExec(q, dbcfg); err != nil { - e := err if pgErr, ok := err.(*pgconn.PgError); ok && pgErr.Code == pgerrcode.UniqueViolation { - e = repoerr.ErrConflict + err = repoerr.ErrConflict } if errRollback := cr.rollback("failed to insert a Config", tx); errRollback != nil { return "", errors.Wrap(err, errRollback) } - return "", errors.Wrap(repoerr.ErrCreateEntity, e) } if err := insertChannels(ctx, cfg.Owner, cfg.Channels, tx); err != nil {