1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Refactor error system (#33610)

This commit is contained in:
wxiaoguang
2025-02-17 14:13:17 +08:00
committed by GitHub
parent 69de5a65c2
commit f35850f48e
184 changed files with 2100 additions and 2106 deletions

View File

@@ -200,7 +200,7 @@ func RunnersEdit(ctx *context.Context) {
}
if !runner.Editable(ownerID, repoID) {
err = errors.New("no permission to edit this runner")
ctx.NotFound("RunnerDetails", err)
ctx.NotFound(err)
return
}
@@ -252,7 +252,7 @@ func RunnersEditPost(ctx *context.Context) {
return
}
if !runner.Editable(ownerID, repoID) {
ctx.NotFound("RunnerDetailsEditPost.Editable", util.NewPermissionDeniedErrorf("no permission to edit this runner"))
ctx.NotFound(util.NewPermissionDeniedErrorf("no permission to edit this runner"))
return
}
@@ -306,7 +306,7 @@ func RunnerDeletePost(ctx *context.Context) {
}
if !runner.Editable(rCtx.OwnerID, rCtx.RepoID) {
ctx.NotFound("RunnerDeletePost", util.NewPermissionDeniedErrorf("no permission to delete this runner"))
ctx.NotFound(util.NewPermissionDeniedErrorf("no permission to delete this runner"))
return
}
@@ -359,7 +359,7 @@ func findActionsRunner(ctx *context.Context, rCtx *runnersCtx) *actions_model.Ac
ctx.ServerError("FindRunner", err)
return nil
} else if len(got) == 0 {
ctx.NotFound("FindRunner", errors.New("runner not found"))
ctx.NotFound(errors.New("runner not found"))
return nil
}