mirror of
				https://github.com/cdryzun/tg_bot_collections.git
				synced 2025-11-04 16:56:43 +08:00 
			
		
		
		
	fix: replace exception raise with user-friendly message
This commit is contained in:
		@ -172,7 +172,12 @@ def gemini_handler(message: Message, bot: TeleBot) -> None:
 | 
			
		||||
            gemini_reply_text = match.group(1)
 | 
			
		||||
            gemini_reply_text = re.sub(r"\\n", "\n", gemini_reply_text)
 | 
			
		||||
        else:
 | 
			
		||||
            raise e
 | 
			
		||||
            print("No meaningful text was extracted from the exception.")
 | 
			
		||||
            bot.reply_to(
 | 
			
		||||
                message,
 | 
			
		||||
                "Google gemini encountered an error while generating an answer. Please check the log.",
 | 
			
		||||
            )
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        bot.reply_to(
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user