Commit a521f432 authored by David Huss's avatar David Huss 💬
Browse files

Catch malformed XML responses and print them

parent 058a681b
......@@ -49,7 +49,13 @@ def request_meetings(secret: Secret, bbb_url: Url, user_config_path: str) -> Xml
click.edit(filename=user_config_path)
exit()
try:
root = ElementTree.XML(r.text)
except xml.etree.ElementTree.ParseError as e:
click.echo("{} The XML returned from {} returned an xml.etree.ElementTree.ParseError. The response text from the Server was:\n{}".format(click.style('Error:', fg='red', bold=True), url, r.text))
print("Exiting...")
exit()
xmldict = XmlDictConfig(root)
if "returncode" in xmldict.keys():
if xmldict['returncode'] == "FAILED":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment