1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +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

@@ -148,7 +148,7 @@ func EditMilestone(ctx *context.Context) {
m, err := issues_model.GetMilestoneByRepoID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id"))
if err != nil {
if issues_model.IsErrMilestoneNotExist(err) {
ctx.NotFound("", nil)
ctx.NotFound(nil)
} else {
ctx.ServerError("GetMilestoneByRepoID", err)
}
@@ -184,7 +184,7 @@ func EditMilestonePost(ctx *context.Context) {
m, err := issues_model.GetMilestoneByRepoID(ctx, ctx.Repo.Repository.ID, ctx.PathParamInt64("id"))
if err != nil {
if issues_model.IsErrMilestoneNotExist(err) {
ctx.NotFound("", nil)
ctx.NotFound(nil)
} else {
ctx.ServerError("GetMilestoneByRepoID", err)
}
@@ -218,7 +218,7 @@ func ChangeMilestoneStatus(ctx *context.Context) {
if err := issues_model.ChangeMilestoneStatusByRepoIDAndID(ctx, ctx.Repo.Repository.ID, id, toClose); err != nil {
if issues_model.IsErrMilestoneNotExist(err) {
ctx.NotFound("", err)
ctx.NotFound(err)
} else {
ctx.ServerError("ChangeMilestoneStatusByIDAndRepoID", err)
}
@@ -245,7 +245,7 @@ func MilestoneIssuesAndPulls(ctx *context.Context) {
milestone, err := issues_model.GetMilestoneByRepoID(ctx, ctx.Repo.Repository.ID, milestoneID)
if err != nil {
if issues_model.IsErrMilestoneNotExist(err) {
ctx.NotFound("GetMilestoneByID", err)
ctx.NotFound(err)
return
}