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

Merge pull request #1719 from JessonChan/err_ctrler

multiple response.WriteHeader calls
This commit is contained in:
astaxie
2016-03-09 19:18:09 +08:00
5 changed files with 24 additions and 10 deletions

View File

@ -261,7 +261,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)