middleware: recovery handles panics in all handlers

Also, changes the order of the middleware so that recovery is after the
gzip middleware. Otherwise, a 200 OK is returned instead of a 500 error.
This commit is contained in:
Daniel Lee
2017-11-15 13:51:15 +01:00
parent b2fbb2691b
commit 0d85c63fff
4 changed files with 97 additions and 17 deletions

View File

@ -363,6 +363,7 @@ type scenarioContext struct {
respJson map[string]interface{}
handlerFunc handlerFunc
defaultHandler macaron.Handler
url string
req *http.Request
}