fix(telegram): name empty-string transport errors in adapter log lines
httpx timeout exceptions (ConnectTimeout, ReadTimeout, ...) stringify to "" so every adapter log line built from _redact_telegram_error_text() ended with a blank reason. Fall back to the exception class name. Partial salvage of #111222: only the _redact_telegram_error_text hunk; the transport-layer and polling-recovery hunks are covered by #111221.
This commit is contained in:
@@ -29,7 +29,9 @@ def _redact_telegram_error_text(error: object) -> str:
|
||||
"""Redact secrets from Telegram transport errors before logging or returning them."""
|
||||
text = "" if error is None else str(error)
|
||||
if not text:
|
||||
return text
|
||||
# httpx timeout exceptions (ConnectTimeout, ReadTimeout, ...) stringify to "" — keep the
|
||||
# class name so failure lines never log an empty reason (#111211).
|
||||
return f"<{type(error).__name__}>" if error is not None else text
|
||||
try:
|
||||
from agent.redact import redact_sensitive_text
|
||||
return redact_sensitive_text(text, force=True)
|
||||
|
||||
Reference in New Issue
Block a user