Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Embarrassing
private static async Task<T> WrapAsync<T>(Func<object[], object> target, object[] args, string name)
{
try
{
return await new ChaosWrap<InjectException>().Execute<T>(() => (Task<T>) target(args));
}
catch (Exception e)
{
Console.WriteLine($"Async method `{name}` throws {e.GetType()} exception.");
return default;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.