From d885b4116166e3e6e118d69d4539a3e0d04ee3c3 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 29 Mar 2024 08:01:57 +1100 Subject: [PATCH] When logging TypeLoad exceptions, add a separate line for logging full name of type that failed to load --- MCGalaxy/Server/Logger.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MCGalaxy/Server/Logger.cs b/MCGalaxy/Server/Logger.cs index f78151b74..a71a96494 100644 --- a/MCGalaxy/Server/Logger.cs +++ b/MCGalaxy/Server/Logger.cs @@ -160,7 +160,12 @@ namespace MCGalaxy try { SocketException sockEx = ex as SocketException; - if (sockEx != null) LogSocketErrors(sockEx, sb); + if (sockEx != null) sb.AppendLine("Error: " + sockEx.SocketErrorCode); + } catch { } + + try { + TypeLoadException typeEx = ex as TypeLoadException; + if (typeEx != null) sb.AppendLine("Loading type: " + typeEx.TypeName); } catch { } } @@ -174,9 +179,5 @@ namespace MCGalaxy DescribeError(loadEx, sb); } } - - static void LogSocketErrors(SocketException ex, StringBuilder sb) { - sb.AppendLine("Error: " + ex.SocketErrorCode); - } } } \ No newline at end of file