Update logging to handly empty PMS responses

This commit is contained in:
tomkat83 2016-01-12 14:25:12 +01:00
parent b26b679dc1
commit b2a9f1a453

View file

@ -327,8 +327,13 @@ class DownloadUtils():
self.logMsg("Received an XML response for: %s" % url, 2) self.logMsg("Received an XML response for: %s" % url, 2)
return r return r
except: except:
self.logMsg("Unable to convert the response for: %s" % url, 2) try:
self.logMsg("Content-type was: %s" % r.headers['content-type'], 2) if r.text == '' and r.status_code == 200:
self.logMsg("====== 200 Success ======", 2)
self.logMsg("Answer from PMS does not contain a body", 2)
except:
self.logMsg("Unable to convert the response for: %s" % url, 2)
self.logMsg("Content-type was: %s" % r.headers['content-type'], 2)
else: else:
r.raise_for_status() r.raise_for_status()