ResetBody on EmitError

This commit is contained in:
Makis Maropoulos 2016-06-02 05:05:54 +03:00
parent 28fff6cea9
commit 9a38c34911

View File

@ -201,7 +201,7 @@ func (he *HTTPErrorContainer) OnError(httpStatus int, handler HandlerFunc) {
// EmitError executes the handler of the given error http status code
func (he *HTTPErrorContainer) EmitError(errCode int, ctx *Context) {
ctx.ResetBody()
if errHandler := he.GetByCode(errCode); errHandler != nil {
ctx.SetStatusCode(errCode) // for any case, user can change it after if want to
errHandler.GetHandler().Serve(ctx)