Fix logging a TaskCanceledException out of users control (#2030)
This commit is contained in:
@@ -78,6 +78,14 @@ namespace Discord
|
||||
nextReconnectDelay = 1000; //Reset delay
|
||||
await _connectionPromise.Task.ConfigureAwait(false);
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
// Added back for log out / stop to client. The connection promise would cancel and it would be logged as an error, shouldn't be the case.
|
||||
// ref #2026
|
||||
|
||||
Cancel(); //In case this exception didn't come from another Error call
|
||||
await DisconnectAsync(ex, !reconnectCancelToken.IsCancellationRequested).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Error(ex); //In case this exception didn't come from another Error call
|
||||
|
||||
Reference in New Issue
Block a user