From f89b6e32bae3965b983a5513d2127f7ff5511972 Mon Sep 17 00:00:00 2001 From: Alejandro Menocal Date: Mon, 13 May 2024 08:15:46 -0500 Subject: [PATCH] remove panic, and just log error on team (#14) --- internal/api/api.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index 413ad6c..aceabbd 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -3,7 +3,6 @@ package api import ( "context" "fmt" - "os" "strings" "github.com/gofri/go-github-ratelimit/github_ratelimit" @@ -323,8 +322,7 @@ func CreateTeam(name string, description string, privacy string, parentTeamName if strings.Contains(err.Error(), "Name must be unique for this org") { fmt.Println("Error creating team, team already exists: ", name) } else { - fmt.Println(err.Error()) - os.Exit(1) + fmt.Println("Unable to create team:", name, err.Error()) } } } @@ -342,7 +340,7 @@ func AddTeamRepository(slug string, repo string, permission string) { } else if strings.Contains(err.Error(), "404 Not Found") { fmt.Println("Error adding repository to team, repository not found: ", slug, repo, permission) } else { - panic(err) + fmt.Println("adding repository to team: ", slug, repo, permission, "Unknown error", err, err.Error()) } } }