Last active
May 21, 2020 15:59
-
-
Save thebeebs/26f5df8b750bd80b63008369d9d5ec70 to your computer and use it in GitHub Desktop.
Embarrassing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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