mirror of
https://github.com/kataras/iris.git
synced 2025-03-21 11:16:28 +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
|
// EmitError executes the handler of the given error http status code
|
||||||
func (he *HTTPErrorContainer) EmitError(errCode int, ctx *Context) {
|
func (he *HTTPErrorContainer) EmitError(errCode int, ctx *Context) {
|
||||||
|
ctx.ResetBody()
|
||||||
if errHandler := he.GetByCode(errCode); errHandler != nil {
|
if errHandler := he.GetByCode(errCode); errHandler != nil {
|
||||||
ctx.SetStatusCode(errCode) // for any case, user can change it after if want to
|
ctx.SetStatusCode(errCode) // for any case, user can change it after if want to
|
||||||
errHandler.GetHandler().Serve(ctx)
|
errHandler.GetHandler().Serve(ctx)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user