Skip to content

Each matching exception handler/action is invoked at most once #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2022

Conversation

xczdbb
Copy link
Contributor

@xczdbb xczdbb commented Jul 19, 2022

Currently base exception handlers/actions will be executed multiple times when a derived exception is thrown.
For example you have MyExceptionHandler:IRequestExceptionHandler<MyRequest, MyResponse>, it will be invoked twice when MyException:Exception is thrown. Its invocation count grows with the exception inheritance.

This PR fixes this bug by checking handler/action type, please note that checking interface types is not enough because different interfaces can share the same handler/action type.

@inary-wrk
Copy link

@jbogard Can you please review this PR.

@jbogard
Copy link
Owner

jbogard commented Jul 29, 2022

I made some changes to this PR to switch to pure LINQ for resolving all the distinct handlers per type

@jbogard jbogard merged commit bc00bea into jbogard:master Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants