You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
Motivation
There's exception handling that is better done inside the async method so that it can see the original stacktrace and can produce useful crash dumps, but it can be painful to repeat in every async method.
The roslyn IDE code is an example, where there is desire to add the following pattern to every async method:
Would it be useful to also be able to apply this attribute to specific methods to opt-in to the exception filter where needed instead of it affecting the entire assembly?
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 modifiedcatch
clause:where we could find the following method
void Report(Exception)
.Motivation
There's exception handling that is better done inside the async method so that it can see the original stacktrace and can produce useful crash dumps, but it can be painful to repeat in every async method.
The roslyn IDE code is an example, where there is desire to add the following pattern to every async method:
Example
FatalError
Design Meetings
The text was updated successfully, but these errors were encountered: