aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/http.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-30 17:57:38 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-30 17:57:38 -0400
commitfbf274b751c910f1c0123feee705cd6f0a2f7ca4 (patch)
tree5df3e40d9556fbc39bda1f0c53d605cb029a7a24 /routers/repo/http.go
parent422043f422dec1478d090f01d4ade9cb64c0f0c5 (diff)
downloadgitea-fbf274b751c910f1c0123feee705cd6f0a2f7ca4.tar.gz
gitea-fbf274b751c910f1c0123feee705cd6f0a2f7ca4.zip
Fix #220
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r--routers/repo/http.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index f4cc00aaf3..c5856d603c 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -47,13 +47,21 @@ func Http(ctx *middleware.Context, params martini.Params) {
repoUser, err := models.GetUserByName(username)
if err != nil {
- ctx.Handle(500, "repo.GetUserByName", nil)
+ if err == models.ErrUserNotExist {
+ ctx.Handle(404, "repo.Http(GetUserByName)", nil)
+ } else {
+ ctx.Handle(500, "repo.Http(GetUserByName)", nil)
+ }
return
}
repo, err := models.GetRepositoryByName(repoUser.Id, reponame)
if err != nil {
- ctx.Handle(500, "repo.GetRepositoryByName", nil)
+ if err == models.ErrRepoNotExist {
+ ctx.Handle(404, "repo.Http(GetRepositoryByName)", nil)
+ } else {
+ ctx.Handle(500, "repo.Http(GetRepositoryByName)", nil)
+ }
return
}