Skip to content

Commit

Permalink
Use ServerError provided by Context (#14333) (#14345)
Browse files Browse the repository at this point in the history
... instead of InternalServerError by macaron
  • Loading branch information
lunny authored Jan 15, 2021
1 parent 096aa18 commit 49d1139
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions routers/repo/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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") {
Expand Down
4 changes: 2 additions & 2 deletions routers/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 49d1139

Please sign in to comment.