From ec8d410f7c6973e2609203b9ab16631a93133a84 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 15 Mar 2019 17:40:22 +0300 Subject: [PATCH] fix --- main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 47a6732..b7afbae 100755 --- a/main.py +++ b/main.py @@ -184,11 +184,14 @@ def _process_message(bot: Bot, m: Message): if r: user.update_from_message(r) except Unauthorized: - name = conn.root.users[uid].name - del conn.root.users[uid] - commit() - bot.send_message(MANAGEMENT_CHAT, f'{name} был удален ' - f'из-за блокировки бота', parse_mode='html') + try: + name = conn.root.users[uid].name + del conn.root.users[uid] + commit() + bot.send_message(MANAGEMENT_CHAT, f'{name} был удален ' + f'из-за блокировки бота', parse_mode='html') + except Exception: + sentry_sdk.capture_exception() except TelegramError: sentry_sdk.capture_exception()