Improved websocket error logging

This commit is contained in:
RogueException
2015-12-26 03:11:58 -04:00
parent 40f1d8c4e9
commit 4f313ecfa6

View File

@@ -127,7 +127,11 @@ namespace Discord.Net.WebSockets
if (oldState == ConnectionState.Connected)
{
Logger.Info("Disconnected");
var ex = _taskManager.Exception;
if (ex == null)
Logger.Info("Disconnected");
else
Logger.Error("Disconnected", ex);
OnDisconnected(_taskManager.WasUnexpected, _taskManager.Exception);
}
State = ConnectionState.Disconnected;