I have an interface:
Task DoStuff();
And an implementation:
public async Task DoStuff()
{
await DoStuffAndThrowException();
}
Is there a way to use source code generators in order to handle exceptions for example like:
public async Task DoStuff()
{
try
{
await DoStuffAndThrowException();
}
catch (Exception exception)
{
throw new MySpecialException(exception);
}
}
or:
public async Task DoStuff()
{
await DoStuffAndThrowExceptionWrapped();
}
public async Task DoStuffAndThrowExceptionWrapped()
{
try
{
await DoStuffAndThrowException();
}
catch (Exception exception)
{
throw new MySpecialException(exception);
}
}