mirror of https://github.com/zulip/zulip.git
register_server: Improve HTTP error reporting.
This commit is contained in:
parent
fb09c18462
commit
367fed89f2
|
@ -118,8 +118,13 @@ class Command(ZulipBaseCommand):
|
|||
)
|
||||
try:
|
||||
response.raise_for_status()
|
||||
except requests.HTTPError:
|
||||
content_dict = response.json()
|
||||
except requests.HTTPError as e:
|
||||
# Report nice errors from the Zulip API if possible.
|
||||
try:
|
||||
content_dict = response.json()
|
||||
except Exception:
|
||||
raise e
|
||||
|
||||
raise CommandError("Error: " + content_dict["msg"])
|
||||
|
||||
return response
|
||||
|
|
Loading…
Reference in New Issue