This commit is contained in:
astaxie
2013-11-26 11:05:49 +08:00
parent 7b405e9af7
commit ae2e25f4c2
2 changed files with 25 additions and 13 deletions

View File

@@ -1,9 +1,8 @@
package context
import (
"net/http"
"github.com/astaxie/beego/middleware"
"net/http"
)
type Context struct {
@@ -22,12 +21,12 @@ func (ctx *Context) Abort(status int, body string) {
ctx.Output.SetStatus(status)
ctx.Output.Body([]byte(body))
if e, ok := middleware.HTTPExceptionMaps[status]; ok {
if len(body) >= 1 {
e.Description = body
}
panic(e)
}
if e, ok := middleware.HTTPExceptionMaps[status]; ok {
if len(body) >= 1 {
e.Description = body
}
panic(e)
}
}
func (ctx *Context) WriteString(content string) {