We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a9b91f commit aa405c7Copy full SHA for aa405c7
zulip/zulip/__init__.py
@@ -763,6 +763,13 @@ def do_register() -> Tuple[str, int]:
763
# TODO: Make this use our backoff library
764
time.sleep(1)
765
continue
766
+ # Fail fast on clearly misconfigured clients to avoid silent retries.
767
+ if res.get("result") == "error":
768
+ code = res.get("code")
769
+ if code in ("UNAUTHORIZED", "BAD_REQUEST"):
770
+ # UNAUTHORIZED -> bad/expired credentials
771
+ # BAD_REQUEST -> invalid parameters (often bad narrow)
772
+ raise ZulipError(f"{code}: {res.get('msg', '')}")
773
774
if "error" in res["result"]:
775
if res["result"] == "http-error":
0 commit comments