From 322ad2d3c4ed0daefad503b67b46934c6b296f42 Mon Sep 17 00:00:00 2001 From: YAMADA Yutaka Date: Wed, 17 May 2023 00:48:25 +0000 Subject: [PATCH] add log output on error --- gitea/resource_gitea_team.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitea/resource_gitea_team.go b/gitea/resource_gitea_team.go index a7abd36..5ee390d 100644 --- a/gitea/resource_gitea_team.go +++ b/gitea/resource_gitea_team.go @@ -2,6 +2,7 @@ package gitea import ( "fmt" + "log" "strconv" "strings" @@ -347,6 +348,7 @@ func setTeamRepositories(team *gitea.Team, d *schema.ResourceData, meta interfac }, }) if err != nil { + log.Printf("[ERROR] Error listeng team repositories: %s", err) return } if len(existingRepositories) == 0 { @@ -360,6 +362,7 @@ func setTeamRepositories(team *gitea.Team, d *schema.ResourceData, meta interfac } else { _, err = client.RemoveTeamRepository(team.ID, org, exr.Name) if err != nil { + log.Printf("[ERROR] Error removing team repository %q: %s", exr.Name, err) return } } @@ -373,6 +376,7 @@ func setTeamRepositories(team *gitea.Team, d *schema.ResourceData, meta interfac if flag { _, err = client.AddTeamRepository(team.ID, org, repo) if err != nil { + log.Printf("[ERROR] Error adding team repository %q: %s", repo, err) return } }