Dont create aggregate exceptions inside the Run function

This commit is contained in:
RogueException
2015-12-01 05:11:51 -04:00
parent 3027abc044
commit f699e59795

View File

@@ -289,9 +289,9 @@ namespace Discord
{
try
{
asyncAction().Wait();
asyncAction().GetAwaiter().GetResult(); //Avoids creating AggregateExceptions
}
catch (AggregateException ex) when (ex.InnerException is TaskCanceledException) { }
catch (TaskCanceledException) { }
_disconnectedEvent.WaitOne();
}
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary>