From cb57db8328c1acb84b7546bcd1df567213134729 Mon Sep 17 00:00:00 2001 From: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com> Date: Thu, 19 Jan 2023 18:02:34 +0800 Subject: [PATCH] ChatParser: Catch exception in download language file --- MinecraftClient/Protocol/Message/ChatParser.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MinecraftClient/Protocol/Message/ChatParser.cs b/MinecraftClient/Protocol/Message/ChatParser.cs index 54df413b..2c308cd4 100644 --- a/MinecraftClient/Protocol/Message/ChatParser.cs +++ b/MinecraftClient/Protocol/Message/ChatParser.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; @@ -297,6 +298,15 @@ namespace MinecraftClient.Protocol.Message { ConsoleIO.WriteLineFormatted("§8" + string.Format(Translations.chat_save_fail, languageFilePath), acceptnewlines: true); } + catch (Exception e) + { + ConsoleIO.WriteLineFormatted("§8" + Translations.chat_fail, acceptnewlines: true); + if (Config.Logging.DebugMessages) + { + ConsoleIO.WriteLine(e.Message); + ConsoleIO.WriteLine(e.StackTrace ?? ""); + } + } finally { httpClient.Dispose();