aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/middlewares.go
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-01-10 22:34:17 +0100
committerLauris BH <lauris@nix.lv>2018-01-10 23:34:17 +0200
commit65861900cda3bb6d9e2aa80b808b0000383c04b3 (patch)
tree8569d93b6ef092b30b35a4d4da906c6b6950e2ee /routers/repo/middlewares.go
parent45c264f681e3f7e1a22a191029836a690959aac3 (diff)
downloadgitea-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/middlewares.go')
-rw-r--r--routers/repo/middlewares.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/middlewares.go b/routers/repo/middlewares.go
index 1829e0d491..8afad5be64 100644
--- a/routers/repo/middlewares.go
+++ b/routers/repo/middlewares.go
@@ -15,7 +15,7 @@ func SetEditorconfigIfExists(ctx *context.Context) {
if err != nil && !git.IsErrNotExist(err) {
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
if err := models.CreateRepositoryNotice(description); err != nil {
- ctx.Handle(500, "ErrCreatingReporitoryNotice", err)
+ ctx.ServerError("ErrCreatingReporitoryNotice", err)
}
return
}
@@ -47,6 +47,6 @@ func SetDiffViewStyle(ctx *context.Context) {
ctx.Data["IsSplitStyle"] = style == "split"
if err := ctx.User.UpdateDiffViewStyle(style); err != nil {
- ctx.Handle(500, "ErrUpdateDiffViewStyle", err)
+ ctx.ServerError("ErrUpdateDiffViewStyle", err)
}
}