Skip to content

Add and test unhandled exception logging filter logic #2007

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

khalidabuhakmeh
Copy link
Contributor

What issue does this PR address?

The UnhandledExceptionLoggingFilter is current a Func which can either be a single invocation or a multi-cast delegate. This can lead to unintened behaviors if a developer were to use a += instead of =.

This pull request suggests testing to see if there is an invocation list on the delegate and then determining the result of all filters by checking each one. If all are true then the exception should be logged/emitted.

Important: Any code or remarks in your Pull Request are under the following terms:

If You provide us with any comments, bug reports, feedback, enhancements, or modifications proposed or suggested by You for the Software, such Feedback is provided on a non-confidential basis (notwithstanding any notice to the contrary You may include in any accompanying communication), and Licensor shall have the right to use such Feedback at its discretion, including, but not limited to the incorporation of such suggested changes into the Software. You hereby grant Licensor a perpetual, irrevocable, transferable, sublicensable, nonexclusive license under all rights necessary to incorporate and use your Feedback for any purpose, including to make and sell any products and services.

(see our license, section 7)

Introduced `InvokeUnhandledExceptionLoggingFilter` to reason better about unhandled exception filter logic in `LoggingOptions`. Updated `IdentityServerMiddleware` to utilize this method and added unit tests to ensure correct behavior in various scenarios.
@khalidabuhakmeh khalidabuhakmeh added the area/products/identity-server Related to Identity Server label May 9, 2025
@khalidabuhakmeh khalidabuhakmeh self-assigned this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/products/identity-server Related to Identity Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant