Cleaned up websocket exceptions
This commit is contained in:
@@ -83,7 +83,13 @@ namespace Discord.Net.WebSockets
|
|||||||
{
|
{
|
||||||
Exception ex;
|
Exception ex;
|
||||||
if (e is ClosedEventArgs)
|
if (e is ClosedEventArgs)
|
||||||
ex = new Exception($"Received close code {(e as ClosedEventArgs).Code}: {(e as ClosedEventArgs).Reason ?? "No reason"}");
|
{
|
||||||
|
int code = (e as ClosedEventArgs).Code;
|
||||||
|
string reason = (e as ClosedEventArgs).Reason;
|
||||||
|
if (String.IsNullOrEmpty(reason))
|
||||||
|
reason = "No reason";
|
||||||
|
ex = new Exception($"Received close code {code}: {reason}");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ex = new Exception($"Connection lost");
|
ex = new Exception($"Connection lost");
|
||||||
_taskManager.SignalError(ex, isUnexpected: true);
|
_taskManager.SignalError(ex, isUnexpected: true);
|
||||||
|
|||||||
Reference in New Issue
Block a user