Commit 20463fa7 authored by smallfish's avatar smallfish

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

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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment