1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:30:50 +00:00

beego:update the Abort Status

This commit is contained in:
astaxie 2014-07-18 15:38:29 +08:00
parent d17f107fc4
commit 91ee42ceeb

View File

@ -42,7 +42,7 @@ func (ctx *Context) Redirect(status int, localurl string) {
// if middleware.ErrorMaps exists, panic body.
// if middleware.HTTPExceptionMaps exists, panic HTTPException struct with status and body string.
func (ctx *Context) Abort(status int, body string) {
ctx.Output.SetStatus(status)
ctx.ResponseWriter.WriteHeader(status)
// first panic from ErrorMaps, is is user defined error functions.
if _, ok := middleware.ErrorMaps[body]; ok {
panic(body)