From 807572182392cca3d21aae5d61ac00df3efd3b6f Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 13 Feb 2024 22:51:01 +0100 Subject: [PATCH] Minor cleanup in ViewLatestWorkflowRun Use `ctx.ServerError` instead of a separate `log.Error` + `ctx.Error`. `ctx.ServerError` does essentially the same thing, but better. Signed-off-by: Gergely Nagy --- routers/web/repo/actions/view.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 757ff07c0d..94fdd79903 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -22,7 +22,6 @@ import ( "code.gitea.io/gitea/modules/actions" "code.gitea.io/gitea/modules/base" context_module "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/util" @@ -75,8 +74,7 @@ func ViewLatestWorkflowRun(ctx *context_module.Context) { if errors.Is(err, util.ErrNotExist) { ctx.NotFound("GetLatestRunForBranchAndWorkflow", err) } else { - log.Error("GetLatestRunForBranchAndWorkflow: %v", err) - ctx.Error(http.StatusInternalServerError, "Unable to get latest run for workflow on branch") + ctx.ServerError("GetLatestRunForBranchAndWorkflow", err) } return }