mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 00:17:42 +01:00
Fix #220
This commit is contained in:
parent
422043f422
commit
fbf274b751
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue