mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound * Change Handle(403) to NotFound, avoid using macaron's NotFound
This commit is contained in:
parent
45c264f681
commit
65861900cd
48 changed files with 622 additions and 610 deletions
|
@ -34,7 +34,7 @@ func Notices(ctx *context.Context) {
|
|||
|
||||
notices, err := models.Notices(page, setting.UI.Admin.NoticePagingNum)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Notices", err)
|
||||
ctx.ServerError("Notices", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Notices"] = notices
|
||||
|
@ -66,7 +66,7 @@ func DeleteNotices(ctx *context.Context) {
|
|||
// EmptyNotices delete all the notices
|
||||
func EmptyNotices(ctx *context.Context) {
|
||||
if err := models.DeleteNotices(0, 0); err != nil {
|
||||
ctx.Handle(500, "DeleteNotices", err)
|
||||
ctx.ServerError("DeleteNotices", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue