diff options
author | Morgan Bazalgette <git@howl.moe> | 2018-01-10 22:34:17 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-10 23:34:17 +0200 |
commit | 65861900cda3bb6d9e2aa80b808b0000383c04b3 (patch) | |
tree | 8569d93b6ef092b30b35a4d4da906c6b6950e2ee /routers/repo/issue_stopwatch.go | |
parent | 45c264f681e3f7e1a22a191029836a690959aac3 (diff) | |
download | gitea-65861900cda3bb6d9e2aa80b808b0000383c04b3.tar.gz gitea-65861900cda3bb6d9e2aa80b808b0000383c04b3.zip |
Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound
* Change Handle(403) to NotFound, avoid using macaron's NotFound
Diffstat (limited to 'routers/repo/issue_stopwatch.go')
-rw-r--r-- | routers/repo/issue_stopwatch.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/repo/issue_stopwatch.go b/routers/repo/issue_stopwatch.go index f4392849aa..a7d6ed39cc 100644 --- a/routers/repo/issue_stopwatch.go +++ b/routers/repo/issue_stopwatch.go @@ -18,12 +18,12 @@ func IssueStopwatch(c *context.Context) { return } if !c.Repo.CanUseTimetracker(issue, c.User) { - c.Handle(http.StatusNotFound, "CanUseTimetracker", nil) + c.NotFound("CanUseTimetracker", nil) return } if err := models.CreateOrStopIssueStopwatch(c.User, issue); err != nil { - c.Handle(http.StatusInternalServerError, "CreateOrStopIssueStopwatch", err) + c.ServerError("CreateOrStopIssueStopwatch", err) return } @@ -38,12 +38,12 @@ func CancelStopwatch(c *context.Context) { return } if !c.Repo.CanUseTimetracker(issue, c.User) { - c.Handle(http.StatusNotFound, "CanUseTimetracker", nil) + c.NotFound("CanUseTimetracker", nil) return } if err := models.CancelStopwatch(c.User, issue); err != nil { - c.Handle(http.StatusInternalServerError, "CancelStopwatch", err) + c.ServerError("CancelStopwatch", err) return } |