add log output on error

This commit is contained in:
YAMADA Yutaka 2023-05-17 00:48:25 +00:00
parent 9e34636c29
commit 322ad2d3c4

View file

@ -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
}
}