Skip to content

Commit

Permalink
fix: errors.As
Browse files Browse the repository at this point in the history
Signed-off-by: sivchari <[email protected]>
  • Loading branch information
sivchari committed Oct 31, 2024
1 parent 11dd6c7 commit d75a32f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/clusterctl/client/repository/repository_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var (
retryableOperationTimeout = 1 * time.Minute
)

var rateLimitError github.RateLimitError
var rateLimitError *github.RateLimitError

// gitHubRepository provides support for providers hosted on GitHub.
//
Expand Down Expand Up @@ -505,7 +505,7 @@ func (g *gitHubRepository) handleGithubErr(err error, message string, args ...in
return errors.New("rate limit for github api has been reached. Please wait one hour or get a personal API token and assign it to the GITHUB_TOKEN environment variable")
}

var errorResponse github.ErrorResponse
var errorResponse *github.ErrorResponse
if errors.As(err, &errorResponse) {
ghErr := err.(*github.ErrorResponse)
if ghErr.Response.StatusCode == http.StatusNotFound {
Expand Down

0 comments on commit d75a32f

Please sign in to comment.