debug(telegram): log full payload on 4xx to diagnose BUTTON_DATA_INVALID
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 13m29s
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 13m29s
前次 response_body 已確認錯誤碼,這次記錄完整 payload(payload_preview 前 1000 bytes)以找出觸發 BUTTON_DATA_INVALID 的確切欄位。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1378,6 +1378,14 @@ class TelegramGateway:
|
||||
) as span:
|
||||
try:
|
||||
response = await self._http_client.post(url, json=payload)
|
||||
if response.status_code >= 400:
|
||||
import json as _json
|
||||
_payload_str = _json.dumps(payload, ensure_ascii=False)
|
||||
logger.error("telegram_api_rejected", method=method,
|
||||
status=response.status_code,
|
||||
response_body=response.text[:300],
|
||||
payload_len=len(_payload_str),
|
||||
payload_preview=_payload_str[:1000])
|
||||
response.raise_for_status()
|
||||
result = response.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user