20463fa7 by smallfish

Add CustomAbort() for Controller, support status code and body

1 parent 289f050c
......@@ -274,6 +274,11 @@ 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.Abort(status, body)
}
// StopRun makes panic of USERSTOPRUN error and go to recover function if defined.
func (c *Controller) StopRun() {
panic(USERSTOPRUN)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!