Add extra logging for errors
This commit is contained in:
parent
5c1af23f65
commit
f414dfdb77
@ -116,26 +116,26 @@ func (m *Module) homepage(rw http.ResponseWriter, req *http.Request, state *util
|
||||
selRepo = q.Get("repo")
|
||||
repo, _, err := giteaClient.GetRepo(myOrg, selRepo)
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(rw, "GetRepo: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
refs, _, err := giteaClient.GetRepoRefs(myOrg, selRepo, "heads/"+repo.DefaultBranch)
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(rw, "GetRepoRefs: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if len(refs) == 1 {
|
||||
ref := refs[0]
|
||||
commit, _, err := giteaClient.GetSingleCommit(myOrg, selRepo, ref.Object.SHA)
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(rw, "GetSingleCommit: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
selCommitTime = commit.CommitMeta.Created.UTC().Format("20060102150405")
|
||||
selCommitHash = commit.CommitMeta.SHA[:12]
|
||||
goMod, _, err := giteaClient.GetFile(myOrg, selRepo, ref.Object.SHA, "go.mod")
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
http.Error(rw, "go.mod: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
goModStr := string(goMod)
|
||||
|
Loading…
Reference in New Issue
Block a user