From 050a80bbee5e2b7f768e7c752d8d40c35922f2ad Mon Sep 17 00:00:00 2001 From: SlejmUr Date: Wed, 20 Sep 2023 20:54:31 +0200 Subject: [PATCH] better error hanndliing (?) --- PayCheckServerLib/Servers/PC3Server.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PayCheckServerLib/Servers/PC3Server.cs b/PayCheckServerLib/Servers/PC3Server.cs index a9b4f1d..5d5004a 100644 --- a/PayCheckServerLib/Servers/PC3Server.cs +++ b/PayCheckServerLib/Servers/PC3Server.cs @@ -2,6 +2,7 @@ using PayCheckServerLib.Helpers; using PayCheckServerLib.Responses; using PayCheckServerLib.WSController; +using System.Diagnostics; using System.Net.Sockets; using System.Reflection; using System.Security.Authentication; @@ -257,7 +258,20 @@ protected override void OnReceivedRequestError(HttpRequest request, string error protected override void OnError(SocketError error) { Debugger.PrintDebug($"HTTP session caught an error: {error}"); + StackTrace st = new StackTrace(true); + for (int i = 0; i < st.FrameCount; i++) + { + var sf = st.GetFrame(i); + if (sf == null) + continue; + Debugger.PrintDebug(""); + Debugger.PrintDebug($"Method: " + sf.GetMethod()); + Debugger.PrintDebug($"File: " + sf.GetFileName()); + Debugger.PrintDebug($"Line Number: " + sf.GetFileLineNumber()); + Debugger.PrintDebug(""); + } } + } public class PC3WSSServer : WssServer