From 415fc8288ff9c83c99939003657db3c6ac978a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=99=BA=E8=B6=85?= <1012112796@qq.com> Date: Mon, 27 Jul 2020 03:00:48 +0800 Subject: [PATCH] Show 404 page when release not found (#12328) Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao --- routers/repo/release.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/repo/release.go b/routers/repo/release.go index 1845563bcf759..3b8e55f00246e 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -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 }