mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 18:35:23 +02: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
|
@ -17,7 +17,7 @@ import (
|
|||
func IssueWatch(c *context.Context) {
|
||||
watch, err := strconv.ParseBool(c.Req.PostForm.Get("watch"))
|
||||
if err != nil {
|
||||
c.Handle(http.StatusInternalServerError, "watch is not bool", err)
|
||||
c.ServerError("watch is not bool", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ func IssueWatch(c *context.Context) {
|
|||
}
|
||||
|
||||
if err := models.CreateOrUpdateIssueWatch(c.User.ID, issue.ID, watch); err != nil {
|
||||
c.Handle(http.StatusInternalServerError, "CreateOrUpdateIssueWatch", err)
|
||||
c.ServerError("CreateOrUpdateIssueWatch", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue