1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-11 17:01:01 +00:00

accept asta's idea see the talk

https://github.com/astaxie/beego/pull/1719
This commit is contained in:
JessonChan
2016-03-09 15:56:18 +08:00
parent b30ce768f8
commit 9a2696d216
2 changed files with 5 additions and 10 deletions

View File

@ -286,7 +286,7 @@ func (c *Controller) Abort(code string) {
// CustomAbort stops controller handler and show the error data, it's similar Aborts, but support status code and body.
func (c *Controller) CustomAbort(status int, body string) {
c.Ctx.ResponseWriter.WriteHeader(status)
c.Ctx.Output.Status = status
// first panic from ErrorMaps, is is user defined error functions.
if _, ok := ErrorMaps[body]; ok {
panic(body)