diff --git a/controller.go b/controller.go index d5be2ef0..b3b3577f 100644 --- a/controller.go +++ b/controller.go @@ -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 { diff --git a/router.go b/router.go index 94f4279f..2bc14a87 100644 --- a/router.go +++ b/router.go @@ -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 {