From f699e597957b709722b1042ba56a3326f83b4e0c Mon Sep 17 00:00:00 2001 From: RogueException Date: Tue, 1 Dec 2015 05:11:51 -0400 Subject: [PATCH] Dont create aggregate exceptions inside the Run function --- src/Discord.Net/DiscordWSClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net/DiscordWSClient.cs b/src/Discord.Net/DiscordWSClient.cs index 14f020fda..f1c62ced6 100644 --- a/src/Discord.Net/DiscordWSClient.cs +++ b/src/Discord.Net/DiscordWSClient.cs @@ -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(); } /// Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications.