1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-29 20:53:10 +00:00

Show 404 page when release not found (#12328)

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
赵智超 2020-07-27 03:00:48 +08:00 committed by GitHub
parent d0c690f160
commit 415fc8288f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,6 +134,10 @@ func SingleRelease(ctx *context.Context) {
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag")) release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
if err != nil { if err != nil {
if models.IsErrReleaseNotExist(err) {
ctx.NotFound("GetRelease", err)
return
}
ctx.ServerError("GetReleasesByRepoID", err) ctx.ServerError("GetReleasesByRepoID", err)
return return
} }