Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions zulip/zulip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,13 @@ def do_register() -> Tuple[str, int]:
# TODO: Make this use our backoff library
time.sleep(1)
continue
# Fail fast on clearly misconfigured clients to avoid silent retries.
if res.get("result") == "error":
code = res.get("code")
if code in ("UNAUTHORIZED", "BAD_REQUEST"):
# UNAUTHORIZED -> bad/expired credentials
# BAD_REQUEST -> invalid parameters (often bad narrow)
raise ZulipError(f"{code}: {res.get('msg', '')}")

if "error" in res["result"]:
if res["result"] == "http-error":
Expand Down