fix: Remove OperationCanceledException handling in connecting logic (#1873)
This commit is contained in:
@@ -75,11 +75,6 @@ namespace Discord
|
|||||||
nextReconnectDelay = 1000; //Reset delay
|
nextReconnectDelay = 1000; //Reset delay
|
||||||
await _connectionPromise.Task.ConfigureAwait(false);
|
await _connectionPromise.Task.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException ex)
|
|
||||||
{
|
|
||||||
Cancel(); //In case this exception didn't come from another Error call
|
|
||||||
await DisconnectAsync(ex, !reconnectCancelToken.IsCancellationRequested).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Error(ex); //In case this exception didn't come from another Error call
|
Error(ex); //In case this exception didn't come from another Error call
|
||||||
@@ -143,16 +138,7 @@ namespace Discord
|
|||||||
catch (OperationCanceledException) { }
|
catch (OperationCanceledException) { }
|
||||||
});
|
});
|
||||||
|
|
||||||
try
|
await _onConnecting().ConfigureAwait(false);
|
||||||
{
|
|
||||||
await _onConnecting().ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (TaskCanceledException ex)
|
|
||||||
{
|
|
||||||
Exception innerEx = ex.InnerException ?? new OperationCanceledException("Failed to connect.");
|
|
||||||
Error(innerEx);
|
|
||||||
throw innerEx;
|
|
||||||
}
|
|
||||||
|
|
||||||
await _logger.InfoAsync("Connected").ConfigureAwait(false);
|
await _logger.InfoAsync("Connected").ConfigureAwait(false);
|
||||||
State = ConnectionState.Connected;
|
State = ConnectionState.Connected;
|
||||||
|
|||||||
Reference in New Issue
Block a user