|
|
@ -221,27 +221,31 @@ func Issues(ctx *middleware.Context) { |
|
|
|
issues[i], err = models.GetIssueById(ius[i].IssueId) |
|
|
|
issues[i], err = models.GetIssueById(ius[i].IssueId) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if err == models.ErrIssueNotExist { |
|
|
|
if err == models.ErrIssueNotExist { |
|
|
|
log.Error("user.Issues(#%d): issue not exist", ius[i].IssueId) |
|
|
|
log.Warn("user.Issues(GetIssueById #%d): issue not exist", ius[i].IssueId) |
|
|
|
continue |
|
|
|
continue |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ctx.Handle(500, "user.Issues(GetIssue)", err) |
|
|
|
ctx.Handle(500, fmt.Sprintf("user.Issues(GetIssueById #%d)", ius[i].IssueId), err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
issues[i].Repo, err = models.GetRepositoryById(issues[i].RepoId) |
|
|
|
issues[i].Repo, err = models.GetRepositoryById(issues[i].RepoId) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Handle(500, "user.Issues(GetRepositoryById)", err) |
|
|
|
if err == models.ErrRepoNotExist { |
|
|
|
|
|
|
|
log.Warn("user.Issues(GetRepositoryById #%d): repository not exist", issues[i].RepoId) |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ctx.Handle(500, fmt.Sprintf("user.Issues(GetRepositoryById #%d)", issues[i].RepoId), err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = issues[i].Repo.GetOwner(); err != nil { |
|
|
|
if err = issues[i].Repo.GetOwner(); err != nil { |
|
|
|
ctx.Handle(500, "user.Issues(GetOwner)", err) |
|
|
|
ctx.Handle(500, "user.Issues(GetOwner)", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
issues[i].Poster, err = models.GetUserById(issues[i].PosterId) |
|
|
|
if err = issues[i].GetPoster(); err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
ctx.Handle(500, "user.Issues(GetUserById)", err) |
|
|
|
ctx.Handle(500, "user.Issues(GetUserById)", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|