Commits

Anonymous committed 9ac9746

Correct fault hadling. The fault message can be empty, which before lead to exceptions during xml construction. Added try/catch to fix it.

Comments (0)

Files changed (1)

                 return None
             elif e.code == 500:
                 #read http error body and make xml from it
-                xml = etree.fromstring(e.fp.read())
+                try:
+                    xml = etree.fromstring(e.fp.read())
+                except Exception:
+                    print(e)
+                    return None
                 body = xml.find(SOAP_BODY)
                 if body is None:
                     raise