Skip to content

Commit

Permalink
remove panic, and just log error on team (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
amenocal authored May 13, 2024
1 parent 572aa9c commit f89b6e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package api
import (
"context"
"fmt"
"os"
"strings"

"github.com/gofri/go-github-ratelimit/github_ratelimit"
Expand Down Expand Up @@ -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())
}
}
}
Expand All @@ -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())
}
}
}
Expand Down

0 comments on commit f89b6e3

Please sign in to comment.