refactor: remove NotFoundOrServerError (#39727)

follow up #39722
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-10-10 16:34:53 +02:00
1 parent c30ddc3e14
commit e60d1c7fc8
13 files changed
+29 -41

No files matched your search

+6 -6
View File
@@ -195,12 +195,12 @@ func ChangeProjectStatus(ctx *context.Context) {
project, err := project_model.GetProjectByIDAndOwner(ctx, id, ctx.ContextUser.ID)
if err != nil {
ctx.NotFoundOrServerError("GetProjectByID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("GetProjectByID", err)
return
}
if err := project_model.ChangeProjectStatusByRepoIDAndID(ctx, 0, project.ID, toClose); err != nil {
ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("ChangeProjectStatusByRepoIDAndID", err)
return
}
ctx.JSONRedirect(project_model.ProjectLinkForOrg(ctx.ContextUser, project.ID))
@@ -210,7 +210,7 @@ func ChangeProjectStatus(ctx *context.Context) {
func DeleteProject(ctx *context.Context) {
p, err := project_model.GetProjectByIDAndOwner(ctx, ctx.PathParamInt64("id"), ctx.ContextUser.ID)
if err != nil {
ctx.NotFoundOrServerError("GetProjectByID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("GetProjectByID", err)
return
}
@@ -239,7 +239,7 @@ func RenderEditProject(ctx *context.Context) {
p, err := project_model.GetProjectByIDAndOwner(ctx, ctx.PathParamInt64("id"), ctx.ContextUser.ID)
if err != nil {
ctx.NotFoundOrServerError("GetProjectByID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("GetProjectByID", err)
return
}
@@ -277,7 +277,7 @@ func EditProjectPost(ctx *context.Context) {
p, err := project_model.GetProjectByIDAndOwner(ctx, projectID, ctx.ContextUser.ID)
if err != nil {
ctx.NotFoundOrServerError("GetProjectByID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("GetProjectByID", err)
return
}
@@ -302,7 +302,7 @@ func EditProjectPost(ctx *context.Context) {
func ViewProject(ctx *context.Context) {
project, err := project_model.GetProjectByIDAndOwner(ctx, ctx.PathParamInt64("id"), ctx.ContextUser.ID)
if err != nil {
ctx.NotFoundOrServerError("GetProjectByID", project_model.IsErrProjectNotExist, err)
ctx.ServerError("GetProjectByID", err)
return
}