kataras / iris

The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket:
https://www.iris-go.com
BSD 3-Clause "New" or "Revised" License
25.29k stars 2.47k forks source link

[BUG] Container. GetErrorHandler (ct). HandleError (ct, err) in mvc was called twice consecutively #2474

Open Xsxdot opened 5 months ago

Xsxdot commented 5 months ago

Describe the bug

  1. Container. GetErrorHandler (ct). HandleError (ct, err) in mvc was called twice consecutively
  2. When non-pointer parameters are defined in the controller structure, many unexpected errors may occur. For example, POST and DELETE requests may result in EOF, which is similar to the first bug.

To Reproduce Steps to reproduce the behavior:

  1. type SomeController struct { Ctx iris.Context S service.AkService E *errorc.Err }

ak := adminApi.Party("/ak") akMvc := mvc.New(ak) akMvc.Register(service.AK, errorc.NewErrBuild("AKControllers")) akMvc.Handle(new(admin.AK))

截屏2024-06-29 23 17 43

截屏2024-06-29 23 20 42

twice Errorhandle

截屏2024-06-29 22 56 13

second handle error

截屏2024-06-29 22 56 45

Desktop (please complete the following information):

iris.Version

Additional context Add any other context about the problem here.