fix: additional logging and kill client on IO exception

This commit is contained in:
jtalborough
2025-02-10 14:35:22 -05:00
parent 44fb41b42e
commit 3df50e117a

View File

@@ -523,12 +523,21 @@ namespace PepperDash.Core
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED); KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
ReconnectTimer.Reset(); ReconnectTimer.Reset();
} }
catch (Crestron.SimplSharp.CrestronIO.IOException ex)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Crestron.SimplSharp.CrestronIO.IOException: {0} -\n{1}\n", ex.Message, ex);
Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Crestron.SimplSharp.CrestronIO.IOException Stack Trace: {0}", ex.StackTrace);
Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Crestron.SimplSharp.CrestronIO.IOException Stream write failed");
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
ReconnectTimer.Reset();
}
catch (Exception ex) catch (Exception ex)
{ {
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Exception: {0}", ex.Message); Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Exception: {0} -\n{1}\n", ex.Message, ex);
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Stack Trace: {0}", ex.StackTrace); Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stream write failed"); Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stream write failed");
} }
} }