Browse Source

fix: Remove OperationCanceledException handling in connecting logic (#1873)

tags/3.0.0
Paulo GitHub 3 years ago
parent
commit
7cf84995b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 15 deletions
  1. +1
    -15
      src/Discord.Net.WebSocket/ConnectionManager.cs

+ 1
- 15
src/Discord.Net.WebSocket/ConnectionManager.cs View File

@@ -75,11 +75,6 @@ namespace Discord
nextReconnectDelay = 1000; //Reset delay
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)
{
Error(ex); //In case this exception didn't come from another Error call
@@ -143,16 +138,7 @@ namespace Discord
catch (OperationCanceledException) { }
});

try
{
await _onConnecting().ConfigureAwait(false);
}
catch (TaskCanceledException ex)
{
Exception innerEx = ex.InnerException ?? new OperationCanceledException("Failed to connect.");
Error(innerEx);
throw innerEx;
}
await _onConnecting().ConfigureAwait(false);

await _logger.InfoAsync("Connected").ConfigureAwait(false);
State = ConnectionState.Connected;


Loading…
Cancel
Save