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/home.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/home.go')
-rw-r--r-- | routers/home.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/home.go b/routers/home.go index ce4e0be98d..74125aa2df 100644 --- a/routers/home.go +++ b/routers/home.go @@ -117,7 +117,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { AllPublic: true, }) if err != nil { - ctx.Handle(500, "SearchRepositoryByName", err) + ctx.ServerError("SearchRepositoryByName", err) return } ctx.Data["Keyword"] = keyword @@ -185,7 +185,7 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN if len(opts.Keyword) == 0 || isKeywordValid(opts.Keyword) { users, count, err = models.SearchUsers(opts) if err != nil { - ctx.Handle(500, "SearchUsers", err) + ctx.ServerError("SearchUsers", err) return } } @@ -226,5 +226,5 @@ func ExploreOrganizations(ctx *context.Context) { // NotFound render 404 page func NotFound(ctx *context.Context) { ctx.Data["Title"] = "Page Not Found" - ctx.Handle(404, "home.NotFound", nil) + ctx.NotFound("home.NotFound", nil) } |