From 19405e760f53e586782cae2ac7b1c128fabc7961 Mon Sep 17 00:00:00 2001 From: Ronny Gunawan <3048897+ronnygunawan@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:09:10 +0700 Subject: [PATCH] Show SQL parser error --- .../BotUpdate/Message/MessageUpdateHandler.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BotNet.CommandHandlers/BotUpdate/Message/MessageUpdateHandler.cs b/BotNet.CommandHandlers/BotUpdate/Message/MessageUpdateHandler.cs index 495cd29..58edc28 100644 --- a/BotNet.CommandHandlers/BotUpdate/Message/MessageUpdateHandler.cs +++ b/BotNet.CommandHandlers/BotUpdate/Message/MessageUpdateHandler.cs @@ -214,6 +214,14 @@ await _commandQueue.DispatchAsync( ); return; } + } catch (ParserException exc) { + await _telegramBotClient.SendTextMessageAsync( + chatId: update.Message.Chat.Id, + text: $"{exc.Message}", + parseMode: ParseMode.Html, + replyToMessageId: update.Message.MessageId, + cancellationToken: cancellationToken + ); } catch { // Suppress }