From 50647ffdc09a1da7d1ffc12f90b76bc0e3065685 Mon Sep 17 00:00:00 2001 From: ned Date: Sun, 26 Mar 2023 13:04:16 +0200 Subject: [PATCH] also handle generic error while streaming response --- bot/telegram_bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/telegram_bot.py b/bot/telegram_bot.py index e5b177ec..44856bc0 100644 --- a/bot/telegram_bot.py +++ b/bot/telegram_bot.py @@ -375,6 +375,10 @@ async def prompt(self, update: Update, context: ContextTypes.DEFAULT_TYPE): logging.warning(str(e)) await asyncio.sleep(1) + except Exception as e: + logging.warning(str(e)) + continue + await asyncio.sleep(0.01) i += 1