Skip to content

Commit 12e80c2

Browse files
Merge pull request #347 from ibuildthecloud/main
chore: add fallback err to log message to debug
2 parents 1b557d1 + 3ca50bd commit 12e80c2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/loader/github/github.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ func getCommit(ctx context.Context, account, repo, ref string) (string, error) {
6464
} else if resp.StatusCode != http.StatusOK {
6565
c, _ := io.ReadAll(resp.Body)
6666
resp.Body.Close()
67-
if commit, err := getCommitLsRemote(ctx, account, repo, ref); err == nil {
67+
commit, fallBackErr := getCommitLsRemote(ctx, account, repo, ref)
68+
if fallBackErr == nil {
6869
return commit, nil
6970
}
70-
return "", fmt.Errorf("failed to get GitHub commit of %s/%s at %s: %s %s",
71-
account, repo, ref, resp.Status, c)
71+
return "", fmt.Errorf("failed to get GitHub commit of %s/%s at %s (fallback error %v): %s %s",
72+
account, repo, ref, fallBackErr, resp.Status, c)
7273
}
7374
defer resp.Body.Close()
7475

0 commit comments

Comments
 (0)