Commit b9fdbdf7 authored by astaxie's avatar astaxie

use StopRun to terminate the execution

parent 436f9a74
......@@ -181,7 +181,7 @@ func (c *Controller) Abort(code string) {
}
func (c *Controller) StopRun() {
panic("")
panic("StopRun")
}
func (c *Controller) UrlFor(endpoint string, values ...string) string {
......
......@@ -369,6 +369,9 @@ func (p *ControllerRegistor) UrlFor(endpoint string, values ...string) string {
func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
defer func() {
if err := recover(); err != nil {
if fmt.Sprint(err) == "StopRun" {
return
}
if _, ok := err.(middleware.HTTPException); ok {
// catch intented errors, only for HTTP 4XX and 5XX
} else {
......
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