fix: debug telegram
This commit is contained in:
@@ -54,8 +54,11 @@ async def send_telegram(message: str) -> None:
|
|||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
try:
|
try:
|
||||||
resp = await client.post(url, data=payload)
|
resp = await client.post(url, data=payload)
|
||||||
|
log.info("Telegram response %s: %s", resp.status_code, resp.text)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
log.info("Telegram: сообщение отправлено")
|
log.info("Telegram: сообщение отправлено")
|
||||||
|
except httpx.HTTPStatusError as exc:
|
||||||
|
log.error("Telegram: ошибка %s — %s", exc.response.status_code, exc.response.text)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
log.error("Telegram: ошибка отправки — %s", exc)
|
log.error("Telegram: ошибка отправки — %s", exc)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user