Skip to content

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

Merged
jbogard merged 3 commits intoLuckyPennySoftware:masterfrom
xczdbb:invoke-once
Jul 29, 2022
Merged

Each matching exception handler/action is invoked at most once#767
jbogard merged 3 commits intoLuckyPennySoftware:masterfrom
xczdbb:invoke-once

Conversation

@xczdbb
Copy link
Copy Markdown
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
Copy Markdown

@jbogard Can you please review this PR.

@jbogard
Copy link
Copy Markdown
Collaborator

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 LuckyPennySoftware: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.

3 participants