mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-30 00:01:24 +00:00
if repo does not exist, show a 404 not a 500 (#5900)
This commit is contained in:
parent
a967cf9e99
commit
8b5f6ced22
|
@ -287,7 +287,10 @@ func Issues(ctx *context.Context) {
|
||||||
if repoID > 0 {
|
if repoID > 0 {
|
||||||
if _, ok := showReposMap[repoID]; !ok {
|
if _, ok := showReposMap[repoID]; !ok {
|
||||||
repo, err := models.GetRepositoryByID(repoID)
|
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))
|
ctx.ServerError("GetRepositoryByID", fmt.Errorf("[%d]%v", repoID, err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue