Stop generating AggregateExceptions
This commit is contained in:
@@ -86,7 +86,7 @@ namespace Discord.Net.WebSockets
|
||||
|
||||
protected override async Task ProcessMessage(string json)
|
||||
{
|
||||
base.ProcessMessage(json).Wait(); //This is just a CompletedTask, and we need to avoid asyncs in here
|
||||
base.ProcessMessage(json).GetAwaiter().GetResult(); //This is just a CompletedTask, and we need to avoid asyncs in here
|
||||
var msg = JsonConvert.DeserializeObject<WebSocketMessage>(json);
|
||||
if (msg.Sequence.HasValue)
|
||||
_lastSequence = msg.Sequence.Value;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Discord.Net.WebSockets
|
||||
zlib.CopyTo(decompressed);
|
||||
decompressed.Position = 0;
|
||||
using (var reader = new StreamReader(decompressed))
|
||||
ProcessMessage(reader.ReadToEnd()).Wait();
|
||||
ProcessMessage(reader.ReadToEnd()).GetAwaiter().GetResult();
|
||||
}
|
||||
};
|
||||
_engine.TextMessage += (s, e) => ProcessMessage(e.Message).Wait();
|
||||
|
||||
Reference in New Issue
Block a user