Skip to content

Commit

Permalink
Fix condition for pull not found. (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkrishnan authored Nov 12, 2021
1 parent ce121dc commit d5777d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/events/vcs/github_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,14 @@ func (g *GithubClient) GetPullRequestFromName(repoName string, repoOwner string,
return pull, nil
}
ghErr, ok := err.(*github.ErrorResponse)
if !ok || ghErr.Response.StatusCode != 404 {
if !ok || ghErr.Response.StatusCode != http.StatusNotFound {
return pull, err
}
time.Sleep(retryDelay)
}

ghErr, ok := err.(*github.ErrorResponse)
if ok && ghErr.Response.StatusCode != 404 {
if ok && ghErr.Response.StatusCode == http.StatusNotFound {
return pull, &PullRequestNotFound{Err: err}
}
return pull, err
Expand Down

0 comments on commit d5777d3

Please sign in to comment.