mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-15 10:06:26 -04:00
Dont log GitHub PR fetching errors to the Command log (#5600)
In the Command log we only want to see errors for user-initiated actions, not from background activity.
This commit is contained in:
commit
353e3a1e4a
|
|
@ -1,7 +1,6 @@
|
|||
package helpers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
|
@ -831,9 +830,7 @@ func (self *RefreshHelper) refreshGithubPullRequests() {
|
|||
return
|
||||
}
|
||||
|
||||
if err := self.setGithubPullRequests(baseInfo); err != nil {
|
||||
self.c.LogAction(fmt.Sprintf("Error fetching pull requests from GitHub: %s", err.Error()))
|
||||
}
|
||||
self.setGithubPullRequests(baseInfo)
|
||||
}
|
||||
|
||||
type githubRemoteInfo struct {
|
||||
|
|
@ -914,9 +911,7 @@ func (self *RefreshHelper) promptForBaseGithubRepo(githubRemotes []githubRemoteI
|
|||
self.c.Log.Error(err)
|
||||
}
|
||||
|
||||
if err := self.setGithubPullRequests(&info); err != nil {
|
||||
self.c.LogAction(fmt.Sprintf("Error fetching pull requests from GitHub: %s", err.Error()))
|
||||
}
|
||||
self.setGithubPullRequests(&info)
|
||||
return nil
|
||||
})
|
||||
},
|
||||
|
|
@ -944,9 +939,9 @@ func (self *RefreshHelper) rebuildPullRequestsMap() {
|
|||
)
|
||||
}
|
||||
|
||||
func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) error {
|
||||
func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) {
|
||||
if len(self.c.Model().Branches) == 0 {
|
||||
return nil
|
||||
return
|
||||
}
|
||||
|
||||
branches := lo.Filter(self.c.Model().Branches, func(branch *models.Branch, _ int) bool {
|
||||
|
|
@ -958,7 +953,8 @@ func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) err
|
|||
|
||||
prs, err := self.c.Git().GitHub.FetchRecentPRs(branchNames, &baseInfo.serviceInfo, baseInfo.authToken)
|
||||
if err != nil {
|
||||
return err
|
||||
self.c.Log.Error("error fetching pull requests from GitHub: " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
self.c.Model().PullRequests = prs
|
||||
|
|
@ -969,8 +965,6 @@ func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) err
|
|||
self.c.PostRefreshUpdate(self.c.Contexts().Branches)
|
||||
return nil
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *RefreshHelper) savePullRequestsToCache(prs []*models.GithubPullRequest) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue