add logging to mailing error

This commit is contained in:
2025-11-14 14:42:25 +03:00
parent da3af83b3a
commit 5cf9455f76

View File

@@ -4,9 +4,11 @@ from aiogram.types import CallbackQuery, Message
from aiogram_dialog import DialogManager
from aiogram_dialog.widgets.input import MessageInput
from aiogram_dialog.widgets.kbd import Button
from structlog import get_logger
from app.infrastructure.database.crud import get_users
logger = get_logger()
async def message_data(
message: Message,
@@ -56,7 +58,13 @@ async def confirm_mailing(
message_id=source_message_id,
)
success_count += 1
except Exception:
except Exception as e:
logger.warning(
"не удалось отправить сообщение",
user_id=user.tg_id,
error=str(e),
exc_info=True, # добавит traceback
)
pass