Skip to content

Commit

Permalink
if repo does not exist, show a 404 not a 500 (go-gitea#5900)
Browse files Browse the repository at this point in the history
  • Loading branch information
adelowo authored and techknowlogick committed Jan 30, 2019
1 parent a967cf9 commit 8b5f6ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routers/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ func Issues(ctx *context.Context) {
if repoID > 0 {
if _, ok := showReposMap[repoID]; !ok {
repo, err := models.GetRepositoryByID(repoID)
if err != nil {
if models.IsErrRepoNotExist(err) {
ctx.NotFound("GetRepositoryByID", err)
return
} else if err != nil {
ctx.ServerError("GetRepositoryByID", fmt.Errorf("[%d]%v", repoID, err))
return
}
Expand Down

0 comments on commit 8b5f6ce

Please sign in to comment.