kataras / kataras/iris

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

Open
#2,474 0 comments 0 reactions 1 assignee Claimed by @kataras View on GitHub
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/kataras/iris/assets/24730668/c92d8172-8e54-4a1c-9c15-d24e4dae49b6)

![截屏2024-06-29 23 20 42](https://github.com/kataras/iris/assets/24730668/25e978bb-39dc-424d-b962-2153e8055a89)

twice Errorhandle

![截屏2024-06-29 22 56 13](https://github.com/kataras/iris/assets/24730668/2212522a-4293-4284-ac53-402074206cf8)

second handle error

![截屏2024-06-29 22 56 45](https://github.com/kataras/iris/assets/24730668/18e498f9-9d18-4e21-86b7-48159311af87)

**Desktop (please complete the following information):**
- OS: MacOS

**iris.Version**
- e.g. v12.2.11

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.