summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2019-01-30 17:13:39 +0100
committertechknowlogick <matti@mdranta.net>2019-01-30 11:13:39 -0500
commit8b5f6ced22d510a399bf304915ad77c61d6ce7b3 (patch)
treea5cdaacca9b2d0757e239a91eabcfe8e3bdc409e /routers/user
parenta967cf9e99461bbd89b8b26fd41faf9f4ed06010 (diff)
downloadgitea-8b5f6ced22d510a399bf304915ad77c61d6ce7b3.tar.gz
gitea-8b5f6ced22d510a399bf304915ad77c61d6ce7b3.zip
if repo does not exist, show a 404 not a 500 (#5900)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/home.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index daa58b2604..99c747e12c 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -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
}