Skip to content

Commit

Permalink
Merge pull request #111 from CircleCI-Public/brady/circle-10188-bette…
Browse files Browse the repository at this point in the history
…r-api-error-selection

This change allows errors from the API to pass through, which have more accurate description than the ones here.
  • Loading branch information
Zachary Scott authored Sep 18, 2018
2 parents 249a3d6 + 866cf55 commit e9c2278
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,7 @@ func getOrganization(ctx context.Context, logger *logger.Logger, organizationNam

err = graphQLclient.Run(ctx, request, &response)

if err != nil {
err = errors.Wrapf(err, "Unable to find organization %s of vcs-type %s", organizationName, organizationVcs)
} else if response.Organization.ID == "" {
if err == nil && response.Organization.ID == "" {
err = fmt.Errorf("Unable to find organization %s of vcs-type %s", organizationName, organizationVcs)
}

Expand Down Expand Up @@ -519,10 +517,6 @@ func createOrbWithNsID(ctx context.Context, logger *logger.Logger, name string,

err = graphQLclient.Run(ctx, request, &response)

if err != nil {
err = errors.Wrapf(err, "Unable to create orb %s for namespaceID %s", name, namespaceID)
}

return &response.CreateOrb.CreateOrbResponse, err
}

Expand Down

0 comments on commit e9c2278

Please sign in to comment.