fix: cleaned up some debug

- in both 'send' methods, print and log the ex message at level 0
- in both 'send' methods, print and log the stack trace at level 1
This commit is contained in:
Nick Genovese
2023-08-23 14:01:13 -04:00
parent 751d157f07
commit 4f48246061

View File

@@ -508,16 +508,16 @@ namespace PepperDash.Core
}
catch (ObjectDisposedException ex)
{
Debug.Console(0, this, "Exception: {0}", ex.Message);
Debug.Console(0, this, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Exception: {0}", ex.Message);
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Stack Trace: {0}", ex.StackTrace);
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
ReconnectTimer.Reset();
}
catch (Exception ex)
{
Debug.Console(0, this, "Exception: {0}", ex.Message);
Debug.Console(0, this, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Exception: {0}", ex.Message);
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stream write failed");
}
@@ -546,16 +546,16 @@ namespace PepperDash.Core
}
catch (ObjectDisposedException ex)
{
Debug.Console(0, this, "Exception: {0}", ex.Message);
Debug.Console(0, this, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Exception: {0}", ex.Message);
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Stack Trace: {0}", ex.StackTrace);
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
ReconnectTimer.Reset();
}
catch (Exception ex)
{
Debug.Console(0, this, "Exception: {0}", ex.Message);
Debug.Console(0, this, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Exception: {0}", ex.Message);
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Stack Trace: {0}", ex.StackTrace);
Debug.Console(1, this, Debug.ErrorLogLevel.Error, "Stream write failed");
}