Skip to content

Commit 49d1139

Browse files
authored
Use ServerError provided by Context (#14333) (#14345)
... instead of InternalServerError by macaron
1 parent 096aa18 commit 49d1139

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

routers/repo/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ func ViewIssue(ctx *context.Context) {
11051105
iw.IssueID = issue.ID
11061106
iw.IsWatching, err = models.CheckIssueWatch(ctx.User, issue)
11071107
if err != nil {
1108-
ctx.InternalServerError(err)
1108+
ctx.ServerError("CheckIssueWatch", err)
11091109
return
11101110
}
11111111
}

routers/repo/projects.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func DeleteProjectBoard(ctx *context.Context) {
353353

354354
pb, err := models.GetProjectBoard(ctx.ParamsInt64(":boardID"))
355355
if err != nil {
356-
ctx.InternalServerError(err)
356+
ctx.ServerError("GetProjectBoard", err)
357357
return
358358
}
359359
if pb.ProjectID != ctx.ParamsInt64(":id") {
@@ -443,7 +443,7 @@ func EditProjectBoardTitle(ctx *context.Context, form auth.EditProjectBoardTitle
443443

444444
board, err := models.GetProjectBoard(ctx.ParamsInt64(":boardID"))
445445
if err != nil {
446-
ctx.InternalServerError(err)
446+
ctx.ServerError("GetProjectBoard", err)
447447
return
448448
}
449449
if board.ProjectID != ctx.ParamsInt64(":id") {

routers/repo/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,11 @@ func UpdatePullRequest(ctx *context.Context) {
696696
}
697697

698698
if err := issue.PullRequest.LoadBaseRepo(); err != nil {
699-
ctx.InternalServerError(err)
699+
ctx.ServerError("LoadBaseRepo", err)
700700
return
701701
}
702702
if err := issue.PullRequest.LoadHeadRepo(); err != nil {
703-
ctx.InternalServerError(err)
703+
ctx.ServerError("LoadHeadRepo", err)
704704
return
705705
}
706706

0 commit comments

Comments
 (0)