mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
ResetBody on EmitError
This commit is contained in:
parent
28fff6cea9
commit
9a38c34911
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user