diff --git a/server/web/controller.go b/server/web/controller.go index 103dd08f..700bd03e 100644 --- a/server/web/controller.go +++ b/server/web/controller.go @@ -411,9 +411,9 @@ 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.Output.Status = status // first panic from ErrorMaps, it is user defined error functions. if _, ok := ErrorMaps[body]; ok { - c.Ctx.Output.Status = status panic(body) } // last panic user string