Fix TypeError when PMS answer empty

This commit is contained in:
croneter 2018-01-09 19:54:54 +01:00
parent f0a2955b83
commit 24f2f60209

View file

@ -306,18 +306,16 @@ class DownloadUtils():
log.warn("Unable to convert the response for: " log.warn("Unable to convert the response for: "
"%s" % url) "%s" % url)
log.warn("Received headers were: %s" % r.headers) log.warn("Received headers were: %s" % r.headers)
log.warn('Received text:') log.warn('Received text: %s', r.text)
log.warn(r.text)
return True return True
elif r.status_code == 403: elif r.status_code == 403:
# E.g. deleting a PMS item # E.g. deleting a PMS item
log.warn('PMS sent 403: Forbidden error for url %s' % url) log.warn('PMS sent 403: Forbidden error for url %s' % url)
return None return None
else: else:
log.warn('Unknown answer from PMS %s with status code %s. '
'Message:' % (url, r.status_code))
r.encoding = 'utf-8' r.encoding = 'utf-8'
log.warn(r.text) log.warn('Unknown answer from PMS %s with status code %s. '
'Message: %s', url, r.status_code, r.text)
return True return True
# And now deal with the consequences of the exceptions # And now deal with the consequences of the exceptions