From 9bac656b7dc0cdc4ba5a391cffa8a47eabf40825 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 26 Jul 2020 17:39:44 -0400 Subject: [PATCH] Show 404 page when release not found (#12328) (#12332) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao Co-authored-by: 赵智超 <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 1845563bcf..3b8e55f002 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 }