diff --git a/memberPlumbing/hid/DoorController.py b/memberPlumbing/hid/DoorController.py index 5483bab..d81c036 100644 --- a/memberPlumbing/hid/DoorController.py +++ b/memberPlumbing/hid/DoorController.py @@ -124,9 +124,13 @@ class DoorController: params={"XML": prefix + xml}, auth=requests.auth.HTTPDigestAuth(self.username, self.password), ) - resp_xml = etree.XML(r.content) + + if r.status_code != 200: + raise RemoteError(r) + # probably meed to be more sane about this - if r.status_code != 200 or len(resp_xml.findall("{*}Error")) > 0: + resp_xml = etree.XML(r.content) + if len(resp_xml.findall("{*}Error")) > 0: raise RemoteError(r) return resp_xml