1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 23:29:42 +02:00

wrap errors up, log at top level only

This commit is contained in:
Harvey Kandola 2017-08-03 10:00:24 +01:00
parent ecc94f31c9
commit 476403bf46
28 changed files with 899 additions and 804 deletions

View file

@ -16,8 +16,6 @@ import (
"sort"
"time"
"github.com/documize/community/core/log"
gogithub "github.com/google/go-github/github"
)
@ -69,10 +67,8 @@ func (s issuesToSort) Less(i, j int) bool {
return false
}
// TODO this seems a very slow approach
iDate, iErr := time.Parse(issuesTimeFormat, s[i].Updated)
log.IfErr(iErr)
jDate, jErr := time.Parse(issuesTimeFormat, s[j].Updated)
log.IfErr(jErr)
iDate, _ := time.Parse(issuesTimeFormat, s[i].Updated)
jDate, _ := time.Parse(issuesTimeFormat, s[j].Updated)
return iDate.Before(jDate)
}
@ -187,14 +183,12 @@ func getIssues(client *gogithub.Client, config *githubConfig) ([]githubIssue, er
}
func refreshIssues(gr *githubRender, config *githubConfig, client *gogithub.Client) (err error) {
if !config.ShowIssues {
return nil
}
gr.Issues, err = getIssues(client, config)
if err != nil {
log.Error("unable to get github issues (cmd)", err)
return err
}