Skip to content

Commit 9a4eb9f

Browse files
committed
update
1 parent e7a66c1 commit 9a4eb9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/web/repo/actions/view.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,10 @@ func Delete(ctx *context_module.Context) {
588588
run, err := actions_model.GetRunByIndex(ctx, repoID, runIndex)
589589
if err != nil {
590590
if errors.Is(err, util.ErrNotExist) {
591-
ctx.HTTPError(http.StatusNotFound, err.Error())
591+
ctx.NotFound(nil)
592592
return
593593
}
594-
ctx.HTTPError(http.StatusInternalServerError, err.Error())
594+
ctx.ServerError("GetRunByIndex", err)
595595
return
596596
}
597597

@@ -601,11 +601,11 @@ func Delete(ctx *context_module.Context) {
601601
}
602602

603603
if err := actions_service.DeleteRun(ctx, run); err != nil {
604-
ctx.HTTPError(http.StatusInternalServerError, err.Error())
604+
ctx.ServerError("DeleteRun", err)
605605
return
606606
}
607607

608-
ctx.JSON(http.StatusOK, struct{}{})
608+
ctx.JSONOK()
609609
}
610610

611611
// getRunJobs gets the jobs of runIndex, and returns jobs[jobIndex], jobs.

0 commit comments

Comments
 (0)