diff options
author | Unknwon <u@gogs.io> | 2015-04-24 05:21:10 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-04-24 05:21:10 -0400 |
commit | c08baee0855807d24a1b86adfcea86d0731e2a3a (patch) | |
tree | c033d0fd4a4c4104b0b6304ec9f2a26c6047ce10 /modules/middleware/context.go | |
parent | 7a7c096fd09035f759168800402389457648f47e (diff) | |
parent | f92bdf875b4ccb2a8eadaa571d112ebf653986d6 (diff) |
Merge branch 'develop' of github.com:gogits/gogs into develop
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r-- | modules/middleware/context.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go index b580de50..200a74cb 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -139,6 +139,13 @@ func (ctx *Context) Handle(status int, title string, err error) { ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status))) } +func (ctx *Context) HandleText(status int, title string) { + if (status / 100 == 4) || (status / 100 == 5) { + log.Error(4, "%s", title) + } + ctx.RenderData(status, []byte(title)) +} + func (ctx *Context) HandleAPI(status int, obj interface{}) { var message string if err, ok := obj.(error); ok { |