From b2933d62763ecccd7b2f7cccaa059eed6a0dd37b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 15 Jan 2021 04:27:22 +0800 Subject: [PATCH] Use ServerError provided by Context (#14333) ... instead of InternalServerError by macaron --- routers/repo/issue.go | 2 +- routers/repo/projects.go | 4 ++-- routers/repo/pull.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 3792a44a8dab4..c24f7520de2e4 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1105,7 +1105,7 @@ func ViewIssue(ctx *context.Context) { iw.IssueID = issue.ID iw.IsWatching, err = models.CheckIssueWatch(ctx.User, issue) if err != nil { - ctx.InternalServerError(err) + ctx.ServerError("CheckIssueWatch", err) return } } diff --git a/routers/repo/projects.go b/routers/repo/projects.go index 948f88375efc4..79fe46ea480d5 100644 --- a/routers/repo/projects.go +++ b/routers/repo/projects.go @@ -353,7 +353,7 @@ func DeleteProjectBoard(ctx *context.Context) { pb, err := models.GetProjectBoard(ctx.ParamsInt64(":boardID")) if err != nil { - ctx.InternalServerError(err) + ctx.ServerError("GetProjectBoard", err) return } if pb.ProjectID != ctx.ParamsInt64(":id") { @@ -443,7 +443,7 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle board, err := models.GetProjectBoard(ctx.ParamsInt64(":boardID")) if err != nil { - ctx.InternalServerError(err) + ctx.ServerError("GetProjectBoard", err) return } if board.ProjectID != ctx.ParamsInt64(":id") { diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 1b3f835e4f4d6..850a0921be6f6 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -696,11 +696,11 @@ func UpdatePullRequest(ctx *context.Context) { } if err := issue.PullRequest.LoadBaseRepo(); err != nil { - ctx.InternalServerError(err) + ctx.ServerError("LoadBaseRepo", err) return } if err := issue.PullRequest.LoadHeadRepo(); err != nil { - ctx.InternalServerError(err) + ctx.ServerError("LoadHeadRepo", err) return }