From 9bd56a8ba07941b22b4550ad27d5ed5533214136 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 15 May 2025 11:55:39 +0800 Subject: [PATCH] Fix Workflow run Not Found page (#34459) (#34466) Backport #34459 by NorthRealm Co-authored-by: NorthRealm <155140859+NorthRealm@users.noreply.github.com> --- routers/web/repo/actions/view.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index dd18c8380d..e15295e9a6 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -584,20 +584,20 @@ func getRunJobs(ctx *context_module.Context, runIndex, jobIndex int64) (*actions run, err := actions_model.GetRunByIndex(ctx, ctx.Repo.Repository.ID, runIndex) if err != nil { if errors.Is(err, util.ErrNotExist) { - ctx.HTTPError(http.StatusNotFound, err.Error()) + ctx.NotFound(nil) return nil, nil } - ctx.HTTPError(http.StatusInternalServerError, err.Error()) + ctx.ServerError("GetRunByIndex", err) return nil, nil } run.Repo = ctx.Repo.Repository jobs, err := actions_model.GetRunJobsByRunID(ctx, run.ID) if err != nil { - ctx.HTTPError(http.StatusInternalServerError, err.Error()) + ctx.ServerError("GetRunJobsByRunID", err) return nil, nil } if len(jobs) == 0 { - ctx.HTTPError(http.StatusNotFound) + ctx.NotFound(nil) return nil, nil }