From 74be702473ee7362b90eb20815f7d1b7160aa308 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Fri, 12 Sep 2025 13:44:48 -0500 Subject: [PATCH] Trap exceptions from process message --- KfChatDotNetBot/ChatBot.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index 024aaf9..774e095 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -291,7 +291,15 @@ public class ChatBot !InitialStartCooldown) { _logger.Debug("Passing message to command interface"); - _botCommands.ProcessMessage(message); + try + { + _botCommands.ProcessMessage(message); + } + catch (Exception e) + { + _logger.Error("ProcessMessage threw an exception"); + _logger.Error(e); + } } // Update or add the element to keep it in sync