Criticité : 🟢 Faible (Pollution de logs, pas d'impact critique)
Occurrences (sur 28 j) : 3 occurrences
Description of the issue
When a user blocks the SentryGuard Telegram bot, TelegramBotService throws an unhandled exception when attempting to send a test message.
While TelegramService correctly catches these errors and processes them via TelegramFailureHandlerService (which disables the integration gracefully), the test message route (TelegramController.sendTestMessage) bypasses the main service and calls TelegramBotService.sendMessage(...) directly. This results in noisy ERROR level logs caught by the global ExceptionsHandler.
Expected Behavior
Inject TelegramFailureHandlerService into TelegramController and wrap the telegramBotService.sendMessage call in a try/catch block within sendTestMessage. If an error occurs, pass it to the failure handler to reuse the existing logic (like disabling Telegram for that user if the error is 403) and return false.
Logs
403: Forbidden: bot was blocked by the user
Error: 403: Forbidden: bot was blocked by the user
at Telegram.callApi
at async TelegramController.sendTestMessage
Criticité : 🟢 Faible (Pollution de logs, pas d'impact critique)
Occurrences (sur 28 j) : 3 occurrences
Description of the issue
When a user blocks the SentryGuard Telegram bot,
TelegramBotServicethrows an unhandled exception when attempting to send a test message.While
TelegramServicecorrectly catches these errors and processes them viaTelegramFailureHandlerService(which disables the integration gracefully), the test message route (TelegramController.sendTestMessage) bypasses the main service and callsTelegramBotService.sendMessage(...)directly. This results in noisyERRORlevel logs caught by the globalExceptionsHandler.Expected Behavior
Inject
TelegramFailureHandlerServiceintoTelegramControllerand wrap thetelegramBotService.sendMessagecall in atry/catchblock withinsendTestMessage. If an error occurs, pass it to the failure handler to reuse the existing logic (like disabling Telegram for that user if the error is 403) and returnfalse.Logs