diff --git a/monitor.py b/monitor.py index e6768e7..e504324 100644 --- a/monitor.py +++ b/monitor.py @@ -54,8 +54,11 @@ async def send_telegram(message: str) -> None: async with httpx.AsyncClient(timeout=10) as client: try: resp = await client.post(url, data=payload) + log.info("Telegram response %s: %s", resp.status_code, resp.text) resp.raise_for_status() log.info("Telegram: сообщение отправлено") + except httpx.HTTPStatusError as exc: + log.error("Telegram: ошибка %s — %s", exc.response.status_code, exc.response.text) except Exception as exc: log.error("Telegram: ошибка отправки — %s", exc)