Show 404 page when release not found (#12328)

Signed-off-by: a1012112796 <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
This commit is contained in:
赵智超
2020-07-26 15:00:48 -04:00
committed by GitHub
co-authored by Lunny Xiao
parent d0c690f160
commit 415fc8288f
+4
View File
@@ -134,6 +134,10 @@ func SingleRelease(ctx *context.Context) {
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
if err != nil {
if models.IsErrReleaseNotExist(err) {
ctx.NotFound("GetRelease", err)
return
}
ctx.ServerError("GetReleasesByRepoID", err)
return
}