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