Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a better user visible error when pipeline references an unrecognised team slug #155

Merged
merged 1 commit into from
May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions buildkite/resource_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ func CreatePipeline(ctx context.Context, d *schema.ResourceData, m interface{})
log.Printf("converting team slug '%s' to an ID", string(team.Team.Slug))
teamID, err := GetTeamID(string(team.Team.Slug), client)
if err != nil {
log.Printf("Unable to get ID for team slug %s", team.Team.Slug)
return diag.FromErr(err)
return diag.FromErr(fmt.Errorf("Unable to get ID for team slug %s (%v)", team.Team.Slug, err))
}
teamsData = append(teamsData, PipelineTeamAssignmentInput{
Id: teamID,
Expand Down Expand Up @@ -576,8 +575,7 @@ func createTeamPipelines(teamPipelines []TeamPipelineNode, pipelineID string, cl
log.Printf("Granting teamPipeline %s %s access to pipeline id '%s'...", teamPipeline.Team.Slug, teamPipeline.AccessLevel, pipelineID)
teamID, err := GetTeamID(string(teamPipeline.Team.Slug), client)
if err != nil {
log.Printf("Unable to get ID for team slug %s", teamPipeline.Team.Slug)
return err
return fmt.Errorf("Unable to get ID for team slug %s (%v)", teamPipeline.Team.Slug, err)
}
params := map[string]interface{}{
"team": graphql.ID(teamID),
Expand Down