Skip to content
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

[Proposal]: async method exception filter #9001

Open
333fred opened this issue Jan 6, 2025 · 0 comments
Open

[Proposal]: async method exception filter #9001

333fred opened this issue Jan 6, 2025 · 0 comments
Assignees
Milestone

Comments

@333fred
Copy link
Member

333fred commented Jan 6, 2025

async method exception filter

Summary

Allow customizing the exception handling produced for async methods.
Adding the following attribute:
[module: AsyncExceptionFilter(typeof(MyExceptionHandler)]
would result in the generated try/catch having a modified catch clause:

catch (Exception e) when (MyExceptionHandler.Report(e); true)
{
    ... existing handling logic ...
}

where we could find the following method void Report(Exception).

Design meetings

@333fred 333fred added this to the Backlog milestone Jan 6, 2025
@333fred 333fred modified the milestones: Backlog, Working Set Jan 6, 2025
@dotnet dotnet locked and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants