Skip to content

Commit b60083f

Browse files
Merge pull request #84 from form3tech-oss/wp-handle-options
feat: Update error handling
2 parents 232511f + a7e3cc2 commit b60083f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

internal/api/github/client.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,13 @@ func (c *Client) GetConfiguration(ctx context.Context, ownerLogin, repoName stri
5858
ownerLogin,
5959
repoName,
6060
configuration.ConfigurationFilePath,
61-
&github.RepositoryContentGetOptions{Ref: defaultBranch},
61+
nil,
6262
)
6363

64-
if resp.StatusCode == http.StatusNotFound {
65-
return nil, ErrNoConfigurationFile
66-
}
67-
6864
if err != nil {
65+
if resp != nil && resp.StatusCode == http.StatusNotFound {
66+
return nil, ErrNoConfigurationFile
67+
}
6968
return nil, fmt.Errorf("error downloading configuration: %w", err)
7069
}
7170

0 commit comments

Comments
 (0)