|
|
@@ -83,7 +83,13 @@ namespace Discord.Net.WebSockets |
|
|
|
{ |
|
|
|
Exception ex; |
|
|
|
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 |
|
|
|
ex = new Exception($"Connection lost"); |
|
|
|
_taskManager.SignalError(ex, isUnexpected: true); |
|
|
|