fix: Stop TaskCanceledException from bubbling up (#1580)
This commit is contained in:
@@ -141,7 +141,16 @@ namespace Discord
|
|||||||
catch (OperationCanceledException) { }
|
catch (OperationCanceledException) { }
|
||||||
});
|
});
|
||||||
|
|
||||||
await _onConnecting().ConfigureAwait(false);
|
try
|
||||||
|
{
|
||||||
|
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