fix: wrap entire SD handler in try-except to prevent crashes when SD is unreachable

This commit is contained in:
Денис Кривоченко
2026-07-30 23:13:03 +07:00
parent 3d6c99ed24
commit d3f6206113
+7
View File
@@ -394,6 +394,13 @@ async def sd_module_handler(msg: Message):
elif msg_text.strip(): elif msg_text.strip():
await msg.answer(UNKNOWN_MAIN_CMD_TEXT, parse_mode="html") await msg.answer(UNKNOWN_MAIN_CMD_TEXT, parse_mode="html")
return return
except Exception as e:
logger.exception(f"❌ [SD Fatal Error] user={getattr(msg.from_user, 'id', 'unknown')}: {e}")
sd_workflow_logger.error(f"❌ [SD Fatal] {e}")
try:
await msg.answer(system_error_text(EMOJI_DIGITS), parse_mode="html")
except Exception:
pass