Closed Themanwithoutaplan closed 4 years ago
The loop has been in the original code, to provide a more expressive error-message. Given an xml-report like this:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>
s:Client
</faultcode>
<faultstring>
UPnPError
</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>
401
</errorCode>
<errorDescription>
Invalid Action
</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
should produce an error-message like that:
'UPnPError: errorCode: 401, errorDescription: Invalid Action'
At least errorCode and errorDescription (as received from the box) should be included.
Ah, a case of a missing test case. I'll one for this.
Should I really squash and merge this again? Will your repository be still in sync afterwards?
I've just pushed a commit with a function that uses requests. We can probably refactor this for more general use. Relying on etree.parse()
to handle stuff, including things we don't control is asking for trouble.
You can squash and merge. Worked fine yesterday and I've set my repo up to track your branch. It's just the usual dance of avoiding local changes before merging.
Ok. Here we go.
No problems merging back in.
Simplified the error code parsing.