fix: handle feishu login network errors

maintainer edit: keep QR login network failures on the expected failure path instead of crashing the channels login command.
This commit is contained in:
chengyongru
2026-06-18 22:38:06 +08:00
committed by Xubin Ren
parent a56cd9710b
commit 5dfdd4f892
2 changed files with 13 additions and 1 deletions
+3 -1
View File
@@ -460,9 +460,11 @@ def qr_register(
Returns None on expected failures (network, auth denied, timeout).
Unexpected errors (bugs, protocol regressions) propagate to the caller.
"""
import httpx
try:
return _qr_register_inner(initial_domain=initial_domain)
except (RuntimeError, OSError, json.JSONDecodeError) as exc:
except (RuntimeError, OSError, json.JSONDecodeError, httpx.HTTPError) as exc:
print(f"[Warning] Registration failed: {exc}")
return None